* Collapse alerting models into a single one
Fixing upgrade migration & tests
* Address feedback
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
* Changed test_cache_logging to be idempotent and not depending on other data than tested one
* Changed cache uid to be depending on table, not datashource
* feat: possible to turn off SQL templating
* turn SQL templating off by default
* Update UPDATING.md
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* fix missing PR number
* fix missing PR number
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* Removed depemdency to unicode example in tests config.
* Added common methods for creating dashboards for tests.
* Added fixtures to all tests which were using unicode example.
* Added cleanup for unicode_test table
* Removed unnecessary fixture parts of unicode dashboard tests
* Parametrized creating slice for tests
* Moved fixtures for unicode test to separate file and refactored to several methods. Added param types and return types.
* Cleandup after fix
* Changed variable names to more readable
* Added cleanup for dashboards and slices
* Applied unicode fixture to charts api tests
* Update schema variable to dtype in dashboard utils
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* Changed variable schema to dtype in dashboards. Replaced accessing first element with one_or_none
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* Fix table existance validation function
* Drop left over table name index in mysql db
* Do not modify model
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
* fix(api): unable to delete virtual dataset because of wrong permission name
* Still delete the dataset even when no permission was found
* migration script to fix possible existing faulty permissions on the db
* black
* fix db migration and one more test
* add more comments to the migration script
* freeze a partial schema of the model on the migration step
* fix mig script
* Update superset/migrations/versions/3fbbc6e8d654_fix_data_access_permissions_for_virtual_.py
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* feat(row-level-security): add filter type and group key
* simplify tests and add custom list widget
* address comments
* use enum value to ensure case sensitive value is used
* feat: SavedQuery REST API for bulk delete
* fix, singular msg and test
* remove 403 from OpenAPI spec
* filter by current user using created_by add sql_tables field
* fixes for new filter, add user field on pre_update, pre_add
* add lru cache to property
* Revert "add lru cache to property"
This reverts commit ad0d9428
* test connection api on databases
* update test connection tests
* update database api test and open api description
* moved test connection to commands
* update error message
* fix isort
* fix mypy
* fix black
* fix mypy pre commit
* feat(database): POST, PUT, DELETE API endpoints
* post tests
* more tests
* lint
* lint
* debug ci
* fix test
* fix test
* fix test
* fix test
* fix test
* fix test
* cleanup
* handle db connection failures
* lint
* skip hive and presto for connection fail test
* fix typo
* Log cache keys to the logs
* Add tests
* Use separate table for the cache keys
* Add migration for the cache lookup table
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
* fix: change public role like gamma procedure
* lint and updating UPDATING with breaking change
* fix updating text
* add test and support PUBLIC_ROLE_LIKE_GAMMA
* fix, cleanup tests
* fix, new test
* fix, public default
* Update superset/config.py
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* add simple public welcome page
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* Add presto to the CI
Sample test data
Datetime conversion
Sample test data
Fix tests
* TODO to switch to timestamps
* Address feedback
* Update requirements
* Add TODOs
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
* refractored alerting to not pass sqlalchemy obj as args
* updated to pass only alert id as arg
* used object id instead of argument
* updated alerts_tests.py to reflect change
Co-authored-by: Jason Davis <@dropbox.com>
* fix(log): log crashes if expired or not authenticated
* fix lint and rison
* add tests
* more tests
* perm fix
* fix test not found
* JS lint
* fix Jest test
* implemented updates to alerting
* fixed imports and teardown
* changed unittest to pytest conventions
* add app_context to tests
Co-authored-by: Jason Davis <@dropbox.com>
* fix(permissions): alpha role is inconsistent
* reverse and allow Alpha to access manager menu
* Bump FAB to 3.0.1rc1 to include del permission fix
* add docs, tests and UPDATING
* EOL
* Fix query view for Alpha
* fix: API marshmallow3 drop utc for naive datetime fields
* fix: API marshmallow3 drop utc for naive datetime fields
* fix, tests
* isort and test
* black
* add and fix test
* fix comment
* fix(chart-data-api): case insensitive evaluation of filter op
* fix(chart-data-api): case insensitive evaluation of filter op
* mypy
* remove print statement
* add test
* feat(api): bump marshmallow and FAB to version 3
* revert query context tests changes
* obey mypy
* fix tests
* ignore types that collide with marshmallow
* preparing for RC2
* fix tests for marshmallow 3
* typing fixes for marshmallow
* fix tests and black
* fix tests
* bump to RC3 and lint
* Test RC4
* Final 3.0.0
* Address comments, fix tests, better naming, docs
* fix test
* couple of fixes, addressing comments
* bumping marshmallow
* Support more table properties for the hive upload
Refactor
Add tests, and refactor them to be pytest friendly
Use lowercase table names
Ignore isort
* Use sql params
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
* feat: add support for alerts
* Add ModelViews
* First pass at adding scheduled Alert support
* Fix syntax errors
* Add log_retention and database to model
* Improving screenshots
* Still refactoring screenshots
* Pass down thumb_size properly
* Progress on screenshot endpoint
* Add alerts.last_eval_dttm and alert query logic
* Getting ready to split compute_screenshot and screenshot/{SHA}
* split the endpoints
* Improving alerting loop
* empty methods
* Add CLI command 'superset alert' that runs a sched loop
* Getting things to work
* email delivery
* A working email\!
* Add feature flag
* Add some description_columns to AlertModelView
* Little tweaks
* Use database.get_df, eval cells for truthiness
* Migrate thumbnail/screenshot functions to use new arg pattern
* Addressing PR feedback
* Update alerts DB migration down_revision
* Resolve _deliver_email arg conflict
* Make mypy happy
* Make isort happy
* Make pylint happy
Co-authored-by: Rob DiCiuccio <rob.diciuccio@gmail.com>
* feat: add database dropdown to dashboard import
Currently, when importing a database from a JSON file, the process
looks at the database name from the source (the info is in the file)
and matches the datasources to that name. If no database by that name
exists, it simply fails.
With this PR, we add a database dropdown that allows the user to specify
which databases the datasources should target as the get upserted.
I want to stress that the code in this area is not in a great shape,
and that the challenge of serializing/deser the nested objects is
challenging, but that there should be a much better way to do this.
One of the improvement (out of scope for this PR) that would allow to
simplify those import/export would be to use UUIDs for
importable/exportable objects.
Another identified issue is the indirections between
`utils/import_expor_{model}.py` on top of `{Model}.import_object`. Not
addressing that here.
Next topic is the MVC stuff. Decided to stick with it for now as this is
more of a [obious missing feat:] than a rewrite.
* isort \!? 0%^$%Y$&?%$^?%0^?
* fix tests
* pre-committing to py3.6
* address dpgaspar's comments
* revert isort
* Switch from nosetest to pytest
Fix schedule tests
Collect pytest coverage
Move pytest config into pytest.ini
Move cov to the pytest.ini
* Append coverage for the 2nd run
* Add coverage to all commands
* Coverage only for tests
* Get coverage from 1 place
* Rename classes to be pytest compatible
* Test coverage for examples and tests
* Max diff to -1
* Explain how to run pytest for the whole project
* Do not append code coverage for the main run
* Do not run coverage on examples
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
* feat: Add new timegrains and convert_dttm to Druid engine spec
* Add TemporalType enum and fix test case
* Remove DATETIME for athena (original spec)
* Add multiple table filters for Row Level Security
* Set ENABLE_ROW_LEVEL_SECURITY back to False (default)
* Merge DB migrations
* Drop table_id column and foreign key on PostgreSQL, MySQL, SQLite
* Support db records migration also
* Support downgrading from the new-fashioned formatted records
* Straighten up migrations
* Update migration's down_revision to comply master branch
* Implement table mutator and examples how to set date defaults
Fix tests
* Fix flaky test
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
* Remove unreferenced function from views/core.py
* Remove excess constants from views/core.py
* Extract CssTemplate-related views to their own file from core.py
* Remove duplicate constant declaration and make the constant less racist
* Move free-floating functions in views/core.py to views/utils.py
* Move AccessRequestsModelView out of views/core.py into its own module
* Move health checks and KV ModelView out of core.py and into their own modules
* Move R model view to its own module
* Move after-request header setting to views/base.py from views/core.py
* black
* mypy
* isort
* Fix reference to imported app
* pylint
* Fix some imports
* Add some missing view imports
* Fix a missing import
* First draft for the slack integration
Fix slack
another typo
another typo
Fix slack
Add channels to the form
another typo
Another set of changes
Make code more transparent
Fix tests
Add logging
logging
use logger
import logging
import logging
import logging
add assert
more logging
Fix channels
Fix channels
* Address comments
* Move slack into a separate module
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
* Add owners and physical/virtual status to Datasets API list endpoint
* black
* Update type definition for DatasourceKind
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* Fixin' tests and mypy
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* remove word cloud from viz.py
* Fix Run in SQL Lab
* remove deprecated python tests
* break out legacy endpoint type into function
* Break out exploreChart from exportChart and implement results type
* Fix jest tests and refactor accordingly
* lint
* Rename v1 payload function
* Add dashboard id to v1 chart data request url params
* Add support for domain sharding to v1 chart data request
* Removing the logic to add timeseries_limit_metric to the data for table viz
* Also make the change in viz_sip_38
* Fix tests
Co-authored-by: michelle_thomas <michelle.thomas@airbnb.com>
* chore: bump pyhton dependencies
* bump flask-testing
* Add note to UPDATING and bump flask-testing in requirements-dev.txt
* fix old sqlparse test case that is fixed with sqlparse==0.3.1
* Fix migration and sqlparse set test
* downgrade alembic
* Downgrade sqlalchemy-utils
* pin sqlalchemy-utils due to regression in 0.36.5
* Refine comment in setup.py
* make cachelib an explicit requirement
* Make all fields optional in QueryObject and fix having_druid schema
* fix: datasource type sql to table
* lint
* Add missing fields
* Refactor tests
* Linting
* Refactor query context fixtures
* Add typing to test func
* Add OpenAPI docs to /api/v1/chart/data EP
* Add missing fields to QueryObject, fix linting and unit test errors
* Fix unit test errors
* abc
* Fix errors uncovered by schema validation and add unit test for invalid payload
* Add schema for response
* Remove unnecessary pylint disable
* Deprecate groupby from query_obj
* Fix query_object bug
* Fix histogram
* Remove groupby from legacy druid connector and fix first batch of unit tests
* Deprecate some unnecessary tests + fix a few others
* Address comments
* hide SIP-38 changes behind feature flag
* Break out further SIP-38 related tests
* Reslove test errors
* Add feature flag to QueryContext
* Resolve tests and bad rebase
* Backport recent changes from viz.py and fix broken DeckGL charts
* Fix bad rebase
* backport #9522 and address comments
* Visualize after running Ctas query (#4)
* Visualize after running Ctas query.
Stub for table viz
Work on the viz
Add JS functionality for Ctas viz
Add test for the table viz flow
Fix test
Add js test for the ctas viz
* Fix tests
* Resolve comments
* Leverate tmpSchema in the query object
* Fix i18n string
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
* Add post processing to QueryObject
* Simplify sort signature and require explicit sort order
* Add new operations and unit tests
* linting
* Address comments
* Simplify test method names
* Address comments
* Linting
* remove unnecessary logic
* Apply strict whitelisting to all getattr calls
* Add checking of rolling_type_options and add/improve docs
* [dashboards] New, tittle and slug OR filter
* Update requirements, because of prison bump
* Tests
* Fix tests
* Avoid like filter on empty string value
* merge master brings strict typing to the table
* filter owners select by text input
* use rison
* fix backend owners filter logic
* use fullname, not username on owners inputs
* fix some tests
* fixing tests
* deterministic tests
* appease linter
* add back search by username
* more comprehensive filter test
* add clarifying text
* formatting...
* [explore view] fix long query issue from Run in SQL LAB Button
* SQL Lab page needs to take the post form data, too
* fix variable names
* updated payload dict, rename hidden form
Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>
* feat: [explore] don't save filters inherited from a dashboard
When navigating to explore from a dashboard context, the current
dashboard filter(s) are passed along to explore so that the context is
kept. So say you're filtering on "country=Romania", in your dashboard
and pivot to explore, that filter is still there and keep on exploring.
Now a common issue is that you'll want to make some tweak to your chart
that are unrelated to the filter, say toggling the legend off for
instance, and then save it. Now you back to your dashboard and even
though you started with an "all countries" dashboard, with a global
filter on country, now that one chart is stuck on "Romania". Typically
you notice this when filtering on something else, say "Italy" and then
that one chart now has two mutually exclusive filters, and show "No data".
Now, the fix is to flag the filter as "extra" (that's the not-so-good internal
name we use for these inherited filters) and make it clear that that
specific filter is special and won't be saved when saving the chart.
* fix build
* [dashboard] Refactor API using SIP-35
* [dashboard] Fix, import
* [dashboard] more tests
* [dashboards] a misc of improvements
* [charts] Fix, DAO and tests
* [dashboards] small exceptions refactor
* [dashboards] lint
* [dashboards] Improves comments on base classes
* [dashboards] lint
* [datasets] new, react listview
* add hidden columns to support filtering by columns not rendered
* throw exception if config is incorrect
* fix database filter
* update endpoints to point to datasets; fix translation strings
* move Link into src/components
* add add new record button to datasets listview
* fix: change database save in DatasourceEditor
This addresses the issue where pointing a datasource to another database
in the datasource editor is not reflected.
Also addresses:
- a minorcosmetic issue in the datasource editor.
- user/owners list not getting populated
* tests
* Make schema name configurable
Fixing unit tests
Fix table quoting
Mypy
Split tests out for sqlite
Grant more permissions for mysql user
Postgres doesn't support if not exists
More logging
Commit for table creation
Priviliges for postgres
Update tests
Resolve comments
Lint
No limits for the CTA queries if configures
* CTA -> CTAS and dict -> {}
* Move database creation to the .travis file
* Black
* Move tweaks to travis db setup
* Remove left over version
* Address comments
* Quote table names in the CTAS queries
* Pass tmp_schema_name for the query execution
* Rebase alembic migration
* Switch to python3 mypy
* SQLLAB_CTA_SCHEMA_NAME_FUNC -> SQLLAB_CTAS_SCHEMA_NAME_FUNC
* Black
* Returning timeseries_limit_metric in table viz get_data
* Fixing issue with include_time field
* Reformatting and adding a test
* Changing if/else structure
* Reformatting
* Support and apply filters.
* Added the UI for row level security, and moved it all under SQLA in order to access the Table model more easily.
* Added a row level security filter documentation entry.
* Accidentally added two new lines to this file.
* Blacked and iSorted, hopefully. Also, sometimes g.user may not be set.
* Another isort, and handling g not having a user attribute another way.
* Let's try this again #CI tests.
* Adjusted import order for isort; I was sure I'd already done this..
* Row level filters should be wrapped in parentheses in case one contains an OR.
* Oops, did not think that would change Black's formatting.
* Changes as per @mistercrunch.
* RLS filters are now many-to-many with Roles.
* Updated documentation to reflect RLS filters supporting multiple rows.
* Let's see what happens when I set it to the previous revision ID
* Updated from upstream.
* There was a pylint error.
* Added RLS ids to the cache keys; modified documentation; added template processing to RLS filters.
* A new migration was merged in.
* Removed RLS cache key from query_object.
* RLS added to the cache_key from query_context.
* Changes as per @etr2460.
* Updating entry for RLS pull request.
* Another migration to skip.
* Changes as per @serenajiang.
* Blacked.
* Blacked and added some attributes to check for.
* Changed to a manual query as per @mistercrunch.
* Blacked.
* Another migration in the meantime.
* Black wanted some whitespace changes.
* AttributeError: 'AnonymousUserMixin' object has no attribute 'id'.
* Oops, did hasattr backwards.
* Changes as per @mistercrunch.
* Doesn't look like text us required here anymore.
* Changes as per @dpgaspar
* Two RLS tests.
* Row level security is now disabled by default via the feature flag ENABLE_ROW_LEVEL_SECURITY.
* New head to revise.
* Changed the comment.
* Add feature flags to control query sharing, KV exposure
* Add tests, fix bug
* Skip test for kv endpoints when they are disabled
* ESLint fixes
* Remove unnecessary binds
* Fix eslint errors
* Add note to UPDATING.md RE: new feature flag options
* Use expanded version of RBAC
* Enable KV_STORE and SHARE_QUERIES_VIA_KV_STORE feature flags in the test environment
* Fix black
* Wrap tagging endpoints in a feature flag (disabled by default)
* Add tests for new feature flag
* Reuse existing feature flag
* Add TAGGING_SYSTEM to feature flags defaulted to False
* Do not show stacktraces on some intentionally-thrown errors
* Fix pylint error
* Fix JavaScript looking for the wrong key in error response from connection check
* format -> f-string
* Run black because PyCharm missed it on the last save
Migrates and completely removes: '/superset/table/<database_id>/<table_name>/<schema>/'
- Guarantees database filtering based on the user permissions
- Full OpenAPI spec
- Better error handling
* fix: shut off all uneeded endpoints
We recently added a new feature to FAB allowing to whitelist the needed
endpoints in ModelView and ModelRestApi.
First, we set our base wrapper class to an empty set, forcing each
class inheriting from it to explicitely turn on the endpoints that
Superset intends to use.
Second, we go ModelView by ModelView to whitelist the actual endpoints
used in the app.
Notes:
* as a result a large set of [unneeded] permissions should be cleaned up
* outside of the "private" use of endpoints in the app, people that have
been using endpoints in their environment for other purposes may
experience loss of functionality
* Tweaking
* Reduce the amount of endpoints using white lists
* Fix, included needed endpoints for dashboard and druid
* Drying things up
* fixes
* limiting more endpoints
* Read only on some FAB model views
* fixing some tests
* fixes
* Fixing more tests
* Addressing comments
* Drying up route_methods
* further drying
Co-authored-by: Daniel Vaz Gaspar <danielvazgaspar@gmail.com>
* [dashboards] New, API for Bulk delete
* [dashboards] Tests
* [dashboards] Fix not found on multiple delete
* [dashboards] Bulk delete partial deletes on not owned dashes
* [dashboards] Improve OpenAPI spec and tests
* [dashboards] Test for bad request
* [dashboards] i18n
* [dashboards] black
* [dashboard] make bulk all or nothing
* [dashboard] Log on sqlalchemy error
* [dashboard] Log on sqlalchemy error
* [charts] New REST API
* [charts] Small improvements
* [charts] Fix, lint
* [charts] Tests and datasource validation
* [charts] Fix, lint
* [charts] DRY post schemas
* [charts] lint and improve type declarations
* [charts] DRY owned REST APIs
* [charts] Small fixes
* [charts] More tests
* [charts] Tests and DRY
* [charts] Tests for update
* [charts] More tests
* [charts] Fix, isort
* [charts] DRY and improve quality
* [charts] DRY and more tests
* [charts] Refactor base for api and schemas
* [charts] Fix bug on partial updates for dashboards
* [charts] Fix missing apache license
* black app.py after merge
* [charts] Fix, missing imports and black
* [api] Log on sqlalchemy error
* [api] isort
* Use PyArrow Table for query result serialization
* Cleanup dev comments
* Additional cleanup
* WIP: tests
* Remove explicit dtype logic from db_engine_specs
* Remove obsolete column property
* SupersetTable column types
* Port SupersetDataFrame methods to SupersetTable
* Add test for nullable boolean columns
* Support datetime values with timezone offsets
* Black formatting
* Pylint
* More linting/formatting
* Resolve issue with timezones not appearing in results
* Types
* Enable running of tests in tests/db_engine_specs
* Resolve application context errors
* Refactor and add tests for pyodbc.Row conversion
* Appease isort, regardless of isort:skip
* Re-enable RESULTS_BACKEND_USE_MSGPACK default based on benchmarks
* Dataframe typing and nits
* Renames to reduce ambiguity
* Require the SQLAlchemy URI when creating a database
* Add migration to make dbs.sqlalchemy_uri not-nullable
* Fixes for black, isort, tests
* Alter migration to use current revision from master as downgrade target
* Update tests to support new db constraint
* black
* re-enable pylint for superset/common/query_context.py
* Re-enable pylint for superset/connectors/base/views.py
* re-enable pylint for superset/connectors/connector_registry.py
* Re-enable pylint for tests/fixtures/pyodbcRow.py
* re-enable pylint for superset/cli.py
* Fix for mypy
* Improve variable naming
* A few more naming fixes
* Build support for schema access in Superset and SQLab
* Lint
* Test for old and new flask
* Black formatting
* Cleanup modified files
* Support schema permissions
* Add migration
* Make it work for slices as well
* TODO and remove unused field
* Apply schema access check to dashboards as well
Cleaner schema permissions check
Fetch schema permissions in 1 query
Bugfix
Better datasource check
Use security manager for permissions checks and remove dead code
Properly handle anon user
Add database permissions on the database updates
Fix schema filtering
Lint / flake changes
Increase cypress request timeout
Run black
Resolve multiple alembic heads
* Use set comprehensions
* Fixes for the pylint
* Disable deprecated druid connector by default
* Add a line in UPDATING.md for the configuration change
* Remove security tests related default-disabled feature
* More test updates
* black
* First cut at app factory
* Setting things back to master
* Working with new FLASK_APP
* Still need to refactor Celery
* CLI mostly working
* Working on unit tests
* Moving cli stuff around a bit
* Removing get in config
* Defaulting test config
* Adding flask-testing
* flask-testing casing
* resultsbackend property bug
* Fixing up cli
* Quick fix for KV api
* Working on save slice
* Fixed core_tests
* Fixed utils_tests
* Most tests working - still need to dig into remaining app_context issue in tests
* All tests passing locally - need to update code comments
* Fixing dashboard tests again
* Blacking
* Sorting imports
* linting
* removing envvar mangling
* blacking
* Fixing unit tests
* isorting
* licensing
* fixing mysql tests
* fixing cypress?
* fixing .flaskenv
* fixing test app_ctx
* fixing cypress
* moving manifest processor around
* moving results backend manager around
* Cleaning up __init__ a bit more
* Addressing PR comments
* Addressing PR comments
* Blacking
* Fixes for running celery worker
* Tuning isort
* Blacking
* adds react based menu for welcome view
* bump fab
* better logic in common_bootstrap_payload
* split up files
* fix spacing and module scope styles
* lint
* render correct template for welcome
* [fix] csv upload when table metadata present
* Remove table from hive spec
* Move upload before table metadata creation
* Refine upload logic, dd unit tests and fix translations
* Use ALLOWED_EXTENSIONS from config
* Address review comments
* Fix error message grammar
* Add return type to hive csv upload and replace first with one_or_none
* Typo fix in CONTRIBUTING.md
* Alter references to config.get('FOO') to use preferred config['FOO']
* Set missing configuration constants in superset/config.py
* Misc. CI fixes
* Add type annotation for FEATURE_FLATGS
* Enable lint checking for files in db_engine_spec that have few to no
lint issues
* Enable lint and fix issue in db_engine_spec/mysql.py
* Enable pylint and fix lint for db_engine_spec/pinot.py
* Enable lint and fix issues for db_engine_specs/hive.py
* Enable lint and fix for db_engine_spec/presto.py
* Re-enable lint on base.py, fix/disable specific failures, including one
bad method signature
* Make flake8 happy after a number of pylint fixes
* Update db_engine_spec_test test cases related to Presto to support
different method naming
* automated reformatting
* One more pylint disable for druid.py
* Find the magic invocation that makes all the lint tools happy
* WIP - Add easily interpretable negative timedelta formatting
* Add unit tests for utils.core.timedelta_f
* Reformat tests.utils_tests.test_timedelta_f test code. Fixes#8274.
* Add type annotations to utils.core.timedelta_f (#8274)
* Replace recursion with absolute value in utils.core.timedelta_f (#8274)
* Rename utils.core.timedelta_f to format_timedelta (#8274)
* Fix small typo (#8274)
* Handle int64 columns with missing data in SQL Lab
* Fix docstring
* Add unit test
* Small fix
* Small fixes
* Fix cursor description update
* Better fix
* Fix unit test, black
* Fix nan comparison in unit test
* Fix regression in time grain addons
* Revert privatization of time_grain_functions
* Fix test
* Rename variable
* Fix test
* Fix typing error
* Refactor and add tests
* Add TODO
* Add support for msgpack results_backend serialization
* Serialize DataFrame with PyArrow rather than JSON
* Adjust dependencies, de-lint
* Add tests for (de)serialization methods
* Add MessagePack config info to Installation docs
* Enable msgpack/arrow serialization by default
* [Fix] Prevent msgpack serialization on synchronous queries
* Add type annotations
* Add check for calls to cache_key_wrapper to avoid unavoidable compilation of query
* Add fetch_values_predicate to check
* Only check relevant attributes
* Address nit
* Add typing to db_engine_specs
* Add more type annotations and docstrings
* Add docstrings and typing to sql_parse and db_engine_specs
* Refine select_star
* Fix execute and add more docstrings
* Revert kwargs change from execute
* Remove redundant or
* Align view and table getter schema types
* Fix return type of latest_partition
* Remove some typing from presto
* Improve docstring for __extract_from_token
* [database] Fix, Removes the limit for the page size, Bump FAB to 2.1.8
Old FAB API had no limits by default, this will keep this behaviour
but only for this endpoint
* [sqllab] Add test for database API
* [sqllab] Add test for database API
* [sqllab] Include page zero on request
* [sqllab] Fix, Black and requirements
* [sqllab] Make database API return unlimited results
* [sqllab] just a test
* [sqllab] Bump FAB to 2.1.9
* [sqllab] Remove unused import
* 7620: Start removing dependencies on requests
* Patch urllib.request.urlopen instead of requests.get
* Try to fix flake8
* More work on flake8 import errors
* First attempt at using urllib with cookies
* Fix pylint/flake8
* Fix test_deliver_slice_csv_attachment
* Fix test_deliver_slice_csv_inline
* Import requests and pydruid conditionally, remove dependency on prison
* Fix flake errors
* Fix load_examples
* Please flake
* Skip tests depending on optional deps
* Try to please flake
* Address review comments
* Remove Druid-related UI
* Revert "Remove Druid-related UI"
This reverts commit d7e0f166cc3f3dd2496b4a666e177f0c191aeb0f.
* Skip a few tests more
* Put imports in right order
* Apply black patch
* Please flake
* Please black, silence flake
* Use flake8 silencing the right way
* Add deps for CI
* [cli] New, command line option to create or set a db URI
* [tests] New, get or create db on utils
* [tests] flake8 and black
* [tests] Fix, remove dummy comments
* [cli] dummy commit to re-trigger build
* [cli] dummy commit to re-trigger build
* Create query_obj for every filter
* Deprecate is_prequery and prequeries from query_obj
* Fix tests
* Fix typos and remove redundant ; from sql
* Add typing to namedtuples and move all query str logic to one place
* Fix unit test
* Allow to pass user for dashboard import cli
Dashboard import assign current user from flask context during import.
But in case of cli import there is no flask user and imported charts
don't have an owner which prevents ability to edit them.
* Reset ownership on dashboard import
For overriding existing charts it requires `owners` property to be set.
* Add tests for reset ownership
* Use ORM to decode dashboards json
Creating instances using ORM allows to normally work with relations
* Fix test_import_dashboard_1_slice test
Previously tests used side-effect of slices import which kept id from
json on insert into db.
* [api] [database] New, migrate to new FAB API side by side
* [database] view and api module reorganization
* [style] Fix, flake8
* [test] [database] Fix, tests for new database view structure
* [style] [database] black
* [database] Fix, missing apache license
* Migrate databaasync api to the new api
* flake8
* More efficient api call
* Revert querySearch to old API, test
* dummy commit
* revert config.py commit
* Remove unused import
* Remove old API view
* Remove new API view
* Add database filter
* Add database filter
* Add database filter
* Remove comments on js
* Fix JS test
* Fix pylint
* QuerySearch new databaseasync API endpoint
* Fix, query search new api endpoint
* Reintroduce old API for smooth side by side migration
* Better naming and use common hooks for view and API
* black it
* Fix, database mixin must come first
* Fix, lint
* fix(sql-lab explore): fixed response data and header type to be aligned
* fix(sql-lab explore): fixed test error caused by incorrect test at master
* fix(sql-lab explore): reformatted
* fix(sql-lab explore): removed unused import
* Remove unnecessary fields from dashboard exported json
This commit makes export respect export_fields and doesn't export
unnecessary relations (like users with passwords hashes) which are
ignored during the import.
* Allow to import dashboard without position_json
In case charts were added from chart-edit page and wasn't re-ordered on
the dashboard position_json field is empty and import was failing with
error.
* Update export/import tests
* [WiP] improve load_examples
related to #7472, longer term we will generate the examples by exporting
them into tarball as in #7472. In the meantime, we need this subset of
the features:
* allowing specifying an alternate database connection for examples
* allowing a --only-metadata flag to `load_examples` to load only
dashboard and chart definitions, no actual data is loaded
* Improve logging
* Rename data->examples
* Load only if not exist
* By default do not load, add a force flag
* fix build
* set published to true
* Allow users to publish dashboards
* Rework publish dashboards feature
- The eye next to the title has been replaced with a [draft] badge
- Published status is now toggled in the Header Action Dropdown
- CRUD list shows published status
* Fix linter errors
* Update javascript tests
* Add tests and change DashboardFilter
Add some tests to make sure the published status is rendered and
Make it so that users cannot see dashboards that are published
if they don't have access to any of the slices within
* Fix some linter errors
* Remove commas from core.py
* Fix some failing tests
* More linter errors I introduced
* Fix more linter errors I introduced
* update alembic migration
* Update design of publish dash feature
* Upgrade migration version
* Secure publish endpoint
* Remove bad quotes
* Give publish span its own style
* fix publish rendering
* Add new test for publish feature
* Update migration
* update slug in test
* Update migration
* Address reviwer comments
* Fix linter errors
* Add licenses
* Remove fetchPublished(), use bootstrap data
* Update migration
* Update croniter to existing version
* Fix linter errors
* Upgrade DB Revisions
* Fix flake8 linter error
* Set all dashboards to published on migration
* Migration proper line spacing
* Fix migration to work with postgres
* UPDATE statement works with postgresql and sqlite hopefully
* Update wording to kick off travis
Fixing a few failing examples, examples were referencing metrics that
were getting auto-generated in the past (like `sum__num`),
that we now prevent from getting created.
* Add extra_require for bigquery to setup.py
* Refactor df_to_db and add df upload capability for BigQuery
* Fix unit tests and clarify kwarg logic
* Fix flake8 errors
* Add minimum versions for bigquery dependencies
* wrap to_gbq in try-catch block and raise error if pandas-gbq is missing
* Fix linting error and make error more generic
* fix: SqlaColumn.type overflow on mysql
Hitting a new error when loading examples around a datatype that exceeds
the 32 chars limit on SqlaColumn.type
Type includes the 'COLLATE utf8mb4_general_ci' suffix which is too
verbose and not needed in that context.
* fix tests
* feat: rough check in for Presto rows and arrays
* fix: presto arrays
* fix: return selected and expanded columns
* fix: add helper methods and unit tests
* fix: only allow exploration of selected columns
* fix: address Beto's comments and add more unit tests
* Move schema name handling in table names from frontend to backend
* Rename all_schema_names to get_all_schema_names
* Fix js errors
* Fix additional js linting errors
* Refactor datasource getters and fix linting errors
* Update js unit tests
* Add python unit test for get_table_names method
* Add python unit test for get_table_names method
* Fix js linting error
* Bugfix to SQL Lab to support tables and schemas with characters that require quoting
* Remove debugging prints
* Add uri encoding to secondary tables call
* Quote schema names for presto
* Quote selected_schema on Snowflake, MySQL and Hive
* Remove redundant parens
* Add python unit tests
* Add js unit test
* Fix flake8 linting error
* Merge lastest from master into lyft-release-sp8 (#7405)
* filter out all nan series (#7313)
* improve not rich tooltip (#7345)
* Create issue_label_bot.yaml (#7341)
* fix: do not save colors without a color scheme (#7347)
* [wtforms] Strip leading/trailing whitespace (#7084)
* [schema] Updating the datasources schema (#5451)
* limit tables/views returned if schema is not provided (#7358)
* limit tables/views returned if schema is not provided
* fix typo
* improve code performance
* handle the case when table name or view name does not present a schema
* Add type anno (#7342)
* Updated local dev instructions to include missing step
* First pass at type annotations
* [schema] Updating the base column schema (#5452)
* Update 937d04c16b64_update_datasources.py (#7361)
* Feature flag for client cache (#7348)
* Feature flag for client cache
* Fix integration test
* Revert "Fix integration test"
This reverts commit 58434ab98a.
* Feature flag for client cache
* Fix integration tests
* Add feature flag to config.py
* Add another feature check
* Fix more integration tests
* Fix raw HTML in SliceAdder (#7338)
* remove backendSync.json (#7331)
* [bubbles] issue when using duplicated metrics (#7087)
* SUPERSET-7: Docker compose config version breaks on Ubuntu 16.04 (#7359)
* SUPERSET-8: Update text in docs copyright footer (#7360)
* SUPERSET-7: Docker compose config version breaks on Ubuntu 16.04
* SUPERSET-8: Extra text in docs copyright footer
* [schema] Adding commits and removing unnecessary foreign-key definitions (#7371)
* Store last selected dashboard in sessionStorage (#7181)
* Store last selected dashboard in sessionStorage
* Fix tests
* [schema] Updating the base metric schema (#5453)
* Fix NoneType bug & fill the test recipients with original recipients if empty (#7365)
* feat: see Presto row and array data types (#7391)
* feat: see Presto row and array data types
* fix: address PR comments
* fix: lint and build issues
* fix: add types
* Incorporate feedback from initial PR (prematurely merged to lyft-release-sp8) (#7415)
* add stronger type hints where possible
* fix: lint issues and add select_star func in Hive
* add missing pkg init
* fix: build issues
* fix: pylint issues
* fix: use logging instead of print
* feat: view presto row objects in data grid
* fix: address feedback
* fix: spacing
* Merge lastest from master into lyft-release-sp8 (#7405)
* filter out all nan series (#7313)
* improve not rich tooltip (#7345)
* Create issue_label_bot.yaml (#7341)
* fix: do not save colors without a color scheme (#7347)
* [wtforms] Strip leading/trailing whitespace (#7084)
* [schema] Updating the datasources schema (#5451)
* limit tables/views returned if schema is not provided (#7358)
* limit tables/views returned if schema is not provided
* fix typo
* improve code performance
* handle the case when table name or view name does not present a schema
* Add type anno (#7342)
* Updated local dev instructions to include missing step
* First pass at type annotations
* [schema] Updating the base column schema (#5452)
* Update 937d04c16b64_update_datasources.py (#7361)
* Feature flag for client cache (#7348)
* Feature flag for client cache
* Fix integration test
* Revert "Fix integration test"
This reverts commit 58434ab98a.
* Feature flag for client cache
* Fix integration tests
* Add feature flag to config.py
* Add another feature check
* Fix more integration tests
* Fix raw HTML in SliceAdder (#7338)
* remove backendSync.json (#7331)
* [bubbles] issue when using duplicated metrics (#7087)
* SUPERSET-7: Docker compose config version breaks on Ubuntu 16.04 (#7359)
* SUPERSET-8: Update text in docs copyright footer (#7360)
* SUPERSET-7: Docker compose config version breaks on Ubuntu 16.04
* SUPERSET-8: Extra text in docs copyright footer
* [schema] Adding commits and removing unnecessary foreign-key definitions (#7371)
* Store last selected dashboard in sessionStorage (#7181)
* Store last selected dashboard in sessionStorage
* Fix tests
* [schema] Updating the base metric schema (#5453)
* Fix NoneType bug & fill the test recipients with original recipients if empty (#7365)
* feat: see Presto row and array data types (#7391)
* feat: see Presto row and array data types
* fix: address PR comments
* fix: lint and build issues
* fix: add types
* add stronger type hints where possible
* fix: lint issues and add select_star func in Hive
* add missing pkg init
* fix: build issues
* fix: pylint issues
* fix: use logging instead of print
* Bump FAB to 2.0.0
* [tests] whitelist SecurityApi login and refresh endpoints
* [style] Fix, C812 missing trailing commas
* [security] Remove SUPERSET_UPDATE_PERMS flag
Registering sources needs to be performed after the views are
initialized on UPDATE_PERMS=False configuration
* [docs] New, FAB_UPDATE_PERMS and flask fab cli
* [docs] Fix, db upgrade needs to come first, create-admin needs a db
* [cli] New, superset init bootstraps all permissions for FAB and Superset
* [style] Fix, flakes
* Adding permission for can_only_access_owned_queries
* Fixing lint adding typing to variable
* Adding test for queryview and enabling /queryview/api/read
* Fixing issues with python typing
* Sparkline dates aren't formatting in Time Series Table (#6976)
* Exclude venv for python linter to ignore
* Fix NaN error
* Fix the white background shown in SQL editor on drag (#7021)
This PR sets the background-color css property on `.ace_scroller` instead of `.ace_content` to prevent the white background shown during resizing of the SQL editor before drag ends.
* Show tooltip with time frame (#6979)
* Fix time filter control (#6978)
* Enhancement of query context and object. (#6962)
* added more functionalities for query context and object.
* fixed cache logic
* added default value for groupby
* updated comments and removed print
(cherry picked from commit d5b9795f87)
* [fix] /superset/slice/id url is too long (#6989)
(cherry picked from commit 6a4d507ab6)
* [WIP] fix user specified JSON metadata not updating dashboard on refresh (#7027)
(cherry picked from commit cc58f0e661)
* feat: add ability to change font size in big number (#7003)
* Add ability to change font sizes in Big Number
* rename big number to header
* Add comment to clarify font size values
* Allow LIMIT to be specified in parameters (#7052)
* [fix] Cursor jumping when editing chart and dashboard titles (#7038)
(cherry picked from commit fc1770f7b7)
* Changing time table viz to pass formatTime a date (#7020)
(cherry picked from commit 7f3c145b1f)
* [db-engine-spec] Aligning Hive/Presto partition logic (#7007)
(cherry picked from commit 05be866117)
* [fix] explore chart from dashboard missed slice title (#7046)
(cherry picked from commit a6d48d4052)
* fix inaccurate data calculation with adata rolling and contribution (#7035)
(cherry picked from commit 0782e831cd)
* Adding warning message for sqllab save query (#7028)
(cherry picked from commit ead3d48133)
* [datasource] Ensuring consistent behavior of datasource editing/saving. (#7037)
* Update datasource.py
* Update datasource.py
(cherry picked from commit c771625f10)
* [csv-upload] Fixing message encoding (#6971)
(cherry picked from commit 48431ab5b9)
* [sql-parse] Fixing LIMIT exceptions (#6963)
(cherry picked from commit 3e076cb60b)
* Adding custom control overrides (#6956)
* Adding extraOverrides to line chart
* Updating extraOverrides to fit with more cases
* Moving extraOverrides to index.js
* Removing webpack-merge in package.json
* Fixing metrics control clearing metric
(cherry picked from commit e6194051f4)
* [sqlparse] Fixing table name extraction for ill-defined query (#7029)
(cherry picked from commit 07c340cf82)
* [missing values] Removing replacing missing values (#4905)
(cherry picked from commit 61add606ca)
* [SQL Lab] Improved query and results tabs rendering reliability (#7082)
closes#7080
(cherry picked from commit 9b58e9f492)
* Fix filter_box migration PR #6523 (#7066)
* Fix filter_box migration PR #6523
* Fix druid-related bug
(cherry picked from commit b210742ad2)
* SQL editor layout makeover (#7102)
This PR includes the following layout and css tweaks:
- Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox
- Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane
- Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars
- css tweaks on the basic.html page so the loading animation appears in the center of the page across the board
(cherry picked from commit 71f1bbd2ec)
* [forms] Fix handling of NULLs
(cherry picked from commit e83a07d3df)
* handle null column_name in sqla and druid models
(cherry picked from commit 2ff721ae07)
* Use metric name instead of metric in filter box (#7106)
(cherry picked from commit 003364e74e)
* Bump python lib croniter to an existing version (#7132)
Package maintainers should really never delete packages, but it appears
this happened with croniter and resulted in breaking our builds.
This PR bumps to a more recent existing version of the library
(cherry picked from commit 215ed392a1)
* Revert PR #6933 (#7162)
* Celery worker for warming up cache
* Remove testing changes
* Add documentation
* Fix lint
* WIP dashboard filters
* Use new cache so it works with dashboards
* Add more unit tests, fix old ones
* Fix flake8 and docs
* Sparkline dates aren't formatting in Time Series Table (#6976)
* Exclude venv for python linter to ignore
* Fix NaN error
* Changing time table viz to pass formatTime a date (#7020)
(cherry picked from commit 7f3c145b1f)
* SQL editor layout makeover (#7102)
This PR includes the following layout and css tweaks:
- Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox
- Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane
- Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars
- css tweaks on the basic.html page so the loading animation appears in the center of the page across the board
(cherry picked from commit 71f1bbd2ec)
* Celery worker for warming up cache
* Remove testing changes
* Add documentation
* Fix lint
* WIP dashboard filters
* Use new cache so it works with dashboards
* Add more unit tests, fix old ones
* Fix flake8 and docs
* Fix bad merge and pylint
* Enable color consistency in a dashboard
Moved actions, minor UI, allowed dashboard copy
Fix linting errors
Undo unintentional change
Updated and added unit tests
Fail quietly if package has not been updated
Fail quietly on dashboard copy if package is old
* Update packages
* Remove unnecessary code
* Addressed Grace's comments
* Small fix for item key
* Reset chart's color during exploration
* Do not reset chart form data when exploring chart
* Add ability to inject statsd client; some py test/reqs updates
- Updated the metrics logger to allow construction with an existing
statsd client, so that it can be configured by external systems or libs.
- added requirements to requirements-dev.txt which are needed to run
tests-eg coverage, nose
- removed dependency on mock lib, it is in python stdlib now
- updated tox.ini to remove the now-superfluous deps
* add license to test file, and remove blank line at EOF
* Bump sqla to >=1.3.1
* Refine mssql column types to only use N-prefixing when necessary
* make join explicit
* replace set with list
* Add additional test case for N-prefix
* Replace engine with dialect and fix linting error
* Remove unneeded import
* Allow for dynamic feature flags
Giving more control over feature flags, allowing administrator to define
custom logic around whether features are enabled for particular users /
roles.
The exposed function can be used for things like:
* progressive rollout of features (1%, 5%, 50%, 100%)
* experimentation
* role-based feature affectation (only admins see a particular feature)
* fix build
* Addressing comments
* Addressing @hughhh's comments
* Force quotes on non-expression time grains on postgres
* Change to or semantics
* Return lower case column name as unmutated
* Add testcases for postgres time grains
* Make expression MixedCase
* Merge dataframe and column name mutation logic, add flag for disabling column aliases and add column name length checking
* Remove custome mutate_label from oracle spec
* Move hashing from mutate_label() to make_label_compatible()
* Remove empty line
* Make label mutating and truncating more robust
* Rename variables and make proposed changes from review
* Always execute labels_expected codepath
* Fix linting error
* Add comments and fix subquery errors
* Refine column compatibility
* Simplify label assignment
* Add unit tests for BQ and Oracle
* Linting
* Adding dropdown to DatasourceControl and ability to change datasource
* Style fixes
* Adding unit tests for datasource/get endpoint
* Fixing issue with dropdown overflow and style changes
* Fixing issues rebasing metadata button and fixing sort for datasource with no name
Summary: We want to allow grouping by on expressions, including the
ability to select expressions (without group-by). The UI ain't good yet
.. it is not at the feature parity of say adhoc filters/metrics that
come with a nice text-box to edit the SQL. But
this suffices for my usecase for now.
(The UI would have to be redone ... but that would require some refactoring
to merge the AdhocFilter/Metric/Popover stuff such that it can be used
for this use case too.)
Also fixed a bug in the SelectControl freeForm selection.
Allow selecting all columns easily: Added a new Select-All special item
that users can select to make all the options in the selectable show
up.
The ability to group by arbitrary expressions is useful because now two
users don't need to create custom computed-fields for this.
- Rename the default feature flags key in `config.py` to DEFAULT_FEATURE_FLAGS
- Merge default feature flags with user defined ones allowing the latter to overwrite the former
- Expose feature_flags for both server and client to use
- Add a utility method for checking whether a feature flag is on on server side
* Add licenses
* More licenses
* Ignore messages.json as they are generated
* More licenses
* Also typescript
* Fix alignment
* Add to svg
* Many more licenses
* more licenses
* Better excludes
* Add licenses to docs and md files
* Pre-finalize licenses
* Fix newlines
* Finalize all sourde licenses
* Fix lint
* Making thrift, pyhive and tableschema as extra_requires
Looking at the dependency tree for license related questions, I noticed
that tableschema had a huge tree, and only people running Hive really
need it. Making this as well as pyhive and thrift optional.
Also bumping some python dependencies
* Run pip-compile
* Removing refs to past.builtins (from future lib)
* Add thrift
* [cosmetic] CRUD's list from 'Add Filter' to 'Filter Results'
* Add global new button
* A better viz type selector
* lint
* Move view to new module, add unit test
* 'Filter Results' -> 'Filter'
* db merge
* Filter -> 'Filter List'
* [WiP] deprecate auto-generated metrics & fix examples
Picking up some leftover pieces not needed anymore since the
MetricsControl
* db merge
* db merge
* fix migration
* Creating metrics required for tests
* [scheduled reports] Add support for scheduled reports
* Scheduled email reports for slice and dashboard visualization
(attachment or inline)
* Scheduled email reports for slice data (CSV attachment on inline table)
* Each schedule has a list of recipients (all of them can receive a single mail,
or separate mails)
* All outgoing mails can have a mandatory bcc - for audit purposes.
* Each dashboard/slice can have multiple schedules.
In addition, this PR also makes a few minor improvements to the celery
infrastructure.
* Create a common celery app
* Added more celery annotations for the tasks
* Introduced celery beat
* Update docs about concurrency / pools
* [scheduled reports] - Debug mode for scheduled emails
* [scheduled reports] - Ability to send test mails
* [scheduled reports] - Test email functionality - minor improvements
* [scheduled reports] - Rebase with master. Minor fixes
* [scheduled reports] - Add warning messages
* [scheduled reports] - flake8
* [scheduled reports] - fix rebase
* [scheduled reports] - fix rebase
* [scheduled reports] - fix flake8
* [scheduled reports] Rebase in prep for merge
* Fixed alembic tree after rebase
* Updated requirements to latest version of packages (and tested)
* Removed py2 stuff
* [scheduled reports] - fix flake8
* [scheduled reports] - address review comments
* [scheduled reports] - rebase with master
* Use py3's f-strings instead of s.format(**locals())
In light of the bug reported here
https://github.com/apache/incubator-superset/issues/6347, which seems
like an odd `.format()` issue in py3, I greped and replaced all
instances of `.format(**locals())` using py3's f-strings
* lint
* fix tests
* Adding cypress tests for showing erros, time range filter, and verbose name
* Adding tests for time range without ago
* Adding test to verify error message showing
* [SIP-5] Open a new /api/v1/query endpoint that takes query_obj
- Introduce a new handle_superset_exception decorator to avoid repeating the logic for catching SupersetExceptions
- Create a query_obj_backfill method that takes form_data and constructs a query_obj that will be constructed in the client in the future. Use the backfill in explore_json.
- Create a new /api/v1/query endpoint that takes query_obj only and returns the payload data. Note the query_obj is constructed in the client. The endpoint currently only handles query_obj for table view viz (we'll be adding support to new viz types as we go).
- Unit test to verify the new endpoint for table view
* fix tests and lint errors
* - Move the new query endpoint into its own api.py view.
- Create QueryObject and QueryContext class to encapsulate query_object to be built from the client and additional info (e.g. datasource) needed to get the data payload for a given query
- Remove the query_obj_backfill as we'll start building the first query_object on the client so it no longer makes sense to have a short-lived backfill for the matter of days.
* Fixing lint and test errors
* Fixing additional lint error from the previous rebase.
* fixing additional lint error
* addressing additional pr comments
* Make /query accept a list of queries in the query_context object.
* fixing a lint error
* - Move time_shift based calculation and since, until check into util
- Add typing info for get_since_until
- Add new unit tests to verify time_shift calculation and the since until check
* Add separate limit setting for SqlLab
Use separate param for wrap sql
Get query limit from config
unit tests for limit control rendering in sql editor
py unit test
pg tests
Add max rows limit
Remove concept of infinity, always require defined limits
consistency
Assert on validation errors instead of tooltip
fix unit tests
attempt persist state
pr comments and linting
* load configs in via common param
* default to 1k
* [utils] gathering/refactoring into a "utils/" folder
Moving current utils.py into utils/core.py and moving other *util*
modules under this new "utils/" as well.
Following steps include eroding at "utils/core.py" and breaking it down
into smaller modules.
* Improve tests
* Make loading examples in scope for tests
* Remove test class attrs examples_loaded and requires_examples
* feat: import/export dashboards via cli
* style: fixed lint error
* test: added test for import and export util
* test: removing import test as it is causing integrity issues
Import is a wrapper around exist functionality so we can go ahead without a test or mock the actual db operation using https://docs.python.org/3/library/unittest.mock.html
And validate the wrapper operations only.
* test: remove test data file
* test: removed usage of reserved keyword id
* Add schema level access control on csv upload
* add db migrate merge point
* fix flake 8
* fix test
* remove unnecessary db migration
* fix flake
* nit
* fix test for test_schemas_access_for_csv_upload_endpoint
* fix test_csv_import test
* use security_manager to check whether schema is allowed to be accessed
* bring security manager to the party
* flake8 & repush to retrigger test
* address comments
* remove trailing comma
* Adds new macro to get filter values from "filters" and "extra_filters"
Adds test for filter_values macro
Adds doco for filter_values
Changes filter_values return type to be a list rather than string
* Makes return value type consistent
- filter_values always return a list
* Bug: fixing async syntax for python 3.7
Rename async to async_ so superset installs for python 3.7.
* Addressing PR comments. Use kwargs instead of explicitly specifying async_ so downstream engines (e.g. PyHive) that supports async can choose to use the async_ in pythonwq3.7 and async in <=python3.6
* addressing additional pr comments
* Field names in big query can contain only alphanumeric and underscore
* bad quote
* better place for mutating labels
* lint
* bug fix thanks to mistercrunch
* lint
* lint again
* Fixing issue with extra params in formData
* Pass in param use_slice_data to decide whether to use slice data
* Fixing core_tests to not use explore_json overrides
* Improve URLs for Chart and Dashboard ModelViews
Prior to this, the ModelView for Chart and Dashboard would be
at `/slicemodelview/list/` and `/dashboardmodelview/list/`.
Now we have cleaner URLs at `/chart/list/` and `/dashboard/list/`
* Fix unrelated js lint
* addressing comments
* Add function to fix dataframe column case
* Fix broken handle_nulls method
* Add case sensitivity option to dedup
* Refactor function definition and call location
* Remove added blank line
* Move df column rename logit to db_engine_spec
* Remove redundant variable
* Update comments in db_engine_specs
* Tie df adjustment to db_engine_spec class attribute
* Fix dedup error
* Linting
* Check for db_engine_spec attribute prior to adjustment
* Rename case sensitivity flag
* Linting
* Remove function that was moved to db_engine_specs
* Get metrics names from utils
* Remove double import and rename dedup variable
* [sql lab] simplify the visualize flow
The "visualize flow" linking SQL Lab to the "explore view" has never
worked so great for people, here's a list of issues:
* it's not really clear to users that their query is wrapped as a
subquery, and the explore view runs queries on top of it
* lint + fix tests
* Addressing comments
* Add interim grains
* Refactor and add blacklist
* Change PT30M to PT0.5H
* Linting
* Linting
* Add time grain addons to config.py and refactor engine spec logic
* Remove redundant import and clean up config.py
* Fix bad rebase
* Implement changes proposed by @betodealmeida
* Revert removal of name from Grain
* Linting
* [sql lab] extract Hive error messages
So pyhive returns an exception object with a stringified thrift error
object. This PR uses a regex to extract the errorMessage portion of that
string.
* Unit test
* Visualization Unicode bug fix
* Fix the build (#5403)
The travis build has been failing for 2 reasons recently
* pylint takes > 10 minutes without outputing
* bad merge confict auto resolve in controls.jsx
* Visualization Unicode bug fix
* Migrate flask_script to the Flask built-in click.
Flask 0.11 is the built-in integration of the click command line interface.
Flask-Migrate support for the new Flask CLI based on Click after Release 2.0.0.
* Resolved merge conflicts.
* Fixed issue introduced from bad merge.
* Fixed flake8 errors, added build to excluded flake8 stuff.
* * Moved the FlaskGroup declaration to the driver script.
* Moved shell context definition to cli.py
* Switched shell context definition to use decorator.
* Moved create_app definition to cli.py
* Fixed InvocationError with a wrapped function
* Added extra newlines between functions
* Removed flask-script dependency.