* 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