Commit Graph

25 Commits

Author SHA1 Message Date
Yongjie Zhao
1afcdfb9fa fix: datetime value should be seconds in sqlite (#21113) 2022-08-18 11:42:58 +08:00
Beto Dealmeida
90130e4b4f feat: simplify SQLite time grain (#19745) 2022-05-03 07:13:33 -07:00
Beto Dealmeida
1ebdaac487 fix: memoize primitives (#19930) 2022-05-02 14:50:56 -07:00
aniaan
5a1c68177e fix(elasticsearch): time_zone setting does not work for cast datetime expressions (#17048)
* fix(elasticsearch): cast does not take effect for time zone settings

* test(elasticsearch): add test

* fix(test): fix typo

* docs(elasticsearch): add annotation

* docs(elasticsearch): add time_zone desc

* docs(elasticsearch): fix typo

* refactor(db_engine): change convert_dttm signature

* fix(test): fix test

* fix(es): add try catch

* fix(test): fix caplog

* fix(test): fix typo
2021-11-25 11:58:44 +02:00
John Bodley
b9ff85d9ea chore(engine): Translate fractional time grains—requires @superset-ui bump (#17078)
* chore(engine): Translate fractional time grains

* Bump @superset-ui

Co-authored-by: John Bodley <john.bodley@airbnb.com>
2021-10-12 21:40:48 -07:00
John Bodley
7e4c940314 chore(pylint): Enable useless-suppression check (#16388)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2021-08-24 03:58:41 +12:00
Ville Brofeldt
5e75baf0cc fix(sqlite): week grain refer to day of week (#16293) 2021-08-17 15:45:08 +03:00
Beto Dealmeida
d625f5f111 feat: show rich error messages on past failed queries (#15158)
* feat: store SIP-40 error payload with queries

* Set errors in query on load
2021-06-16 12:58:14 -07:00
Ville Brofeldt
13f7e0d755 feat(native-filters): add temporal support to select filter (#13622) 2021-03-18 16:15:43 +02:00
Beto Dealmeida
77cae64ccd feat: Add new default dashboard (#12044)
* feat: Add new default dashboard

* Fix license

* Update data URL
2020-12-15 14:21:51 -08:00
Kasia Kucharczyk
af1e8e8839 fix: enable several pylint rules partially in db_engines_specs module (#11000)
* Enabled mssql

* Enabling pylint rules in `mysql.py` from `db_engine_specs`:
- added variable to shorten line and enable `line-too-long`
- `import-error` seems not prompting anymore
- specified exception instead broad-except

* Refactored too long line in `oracle.py` from `db_engine_specs`. Enabled too-long-line pylint rule.

* Changed fstring into string `pinot.py` to reenable `f-string-without-interpolation` rule.

* Enabled `unused-import` rule and changed line to adjust to correct number of characters in `db_engine_specs/postgres.py`.

* Enabled unused-import pylint check in `db_engine_specs/presto.py`

* Enabled unused-import pylint check in `db_engine_specs/snowflake.py`

* Enabled unused-import pylint check in `db_engine_specs/sqlite.py`
2020-09-23 10:47:56 -07:00
Erik Ritter
2055ecc1ba feat: refactor error components and add database issue code (#10473)
* feat: refactor error components and add database issue code

* Apply suggestions from code review

Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>

Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>
2020-08-06 13:22:24 -07:00
Ville Brofeldt
b205ce32b0 feat: Add new timegrains and convert_dttm to Druid engine spec (#10160)
* feat: Add new timegrains and convert_dttm to Druid engine spec

* Add TemporalType enum and fix test case

* Remove DATETIME for athena (original spec)
2020-06-25 12:18:37 +03:00
Will Barrett
8e23d4f369 chore: Upgrade pylint to 2.5.3 and fix most new rules (#10101)
* Bump pylint version to 2.5.3

* Add a global disable for the most common new pylint error

* Fix a bunch of files containing very few errors

* More pylint tweakage, low-hanging fruit

* More easy stuff...

* Fix more erroring files

* Fix the last couple of errors, clean pylint!

* Black

* Fix mypy issue in connectors/druid/models.py
2020-06-18 14:03:42 -07:00
Ville Brofeldt
ef2ebbd570 Add option to specify type specific date truncation functions (#9238) 2020-03-05 07:25:50 +02:00
John Bodley
9f5f8e5d92 [mypy] Enforcing typing for db_engine_specs (#9138) 2020-02-17 23:08:11 -08:00
John Bodley
0a3b121244 [sql] Fixing datetime SQL literal (#8464) 2019-10-29 23:24:48 -07:00
John Bodley
9fc37ea9f1 [ci] Deprecate flake8 (#8409)
* [ci] Deprecate flake8

* Addressing @villebro's comments
2019-10-18 14:44:27 -07:00
Will Barrett
ec86d9de17 Fix lint in superset/db_engine_spec (#8338)
* 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
2019-10-04 09:19:21 -07:00
Beto Dealmeida
12fb8e70cc Show Presto views as views, not tables (#8243)
* WIP

* Implement views in Presto

* Clean up

* Fix CSS

* Fix unit tests

* Add types to database

* Fix circular import
2019-09-18 12:47:10 -07:00
Ville Brofeldt
3250c5ac94 [bugfix] fix timegrain addon regression (#8165)
* 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
2019-09-08 08:34:40 +02:00
Ville Brofeldt
fb51632e18 Add docstrings and typing to db_engine_specs and sql_parse (#8058)
* 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
2019-08-22 06:29:32 +03:00
Ville Brofeldt
346638a339 Add second and minute grains (#7810) 2019-07-03 23:04:34 +03:00
John Bodley
5c58fd1802 [format] Using Black (#7769) 2019-06-25 13:34:48 -07:00
Ville Brofeldt
95291facff Break up db_engine_specs (#7676)
* Refactor db_engine_specs into package

* Rename bigquery class and add epoch funcs

* Fix flake8 errors

* Dynamically load all engine specs

* Fix linting errors and unit tests

* Implement Snowflake epoch time funcs

* Implement Teradata epoch time func

* Fix presto datasource query and remove unused import

* Fix broken datasource query

* Add mypy ignore for false positive

* Add missing license files

* Make create_time_grains_tuple public

* Fix flake8 quote

* Fix incorrect licence header
2019-06-08 11:27:13 -07:00