feat(db engines): add support for Opendistro Elasticsearch (AWS ES) - #12602
Conversation
villebro
left a comment
There was a problem hiding this comment.
Awesome! Quick first pass review
| def make_label_compatible(cls, label: str) -> str: | ||
| new_label = super().make_label_compatible(label) | ||
| return new_label.replace(".", "_") |
There was a problem hiding this comment.
Instead of overriding make_label_compatible, we should define a custom _mutate_label method that does this. See e.g.
superset/superset/db_engine_specs/bigquery.py
Lines 113 to 135 in 9771b82
There was a problem hiding this comment.
thks! I guess we should rename _mutate_label to mutate_label. This is still on it's infancy, still missing the dbapi PR merge and release and on this side the time grains are different for opendistro
There was a problem hiding this comment.
Agree on renaming (let's have a separate PR for that). I guess we should have a separate spec for elasticsearch and odelasticsearch to properly support the differing time grains?
Codecov Report
@@ Coverage Diff @@
## master #12602 +/- ##
==========================================
+ Coverage 65.05% 67.36% +2.31%
==========================================
Files 1021 489 -532
Lines 50095 28772 -21323
Branches 5141 0 -5141
==========================================
- Hits 32587 19383 -13204
+ Misses 17332 9389 -7943
+ Partials 176 0 -176
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
When is the plan to merge this PR? Any time lines? |
|
@syamat this still needs some work on the dialect side also https://github.com/preset-io/elasticsearch-dbapi, but hopping to have this merged in 2 weeks |
| @classmethod | ||
| def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]: | ||
| if target_type.upper() == utils.TemporalType.DATETIME: | ||
| return f"""'{dttm.isoformat(timespec="seconds")}'""" | ||
| return None |
There was a problem hiding this comment.
Doesn't ES/OD support other temporal types like DATE or TIMESTAMP'?
There was a problem hiding this comment.
To my understanding by default Elasticsearch only supports date field type
https://opendistro.github.io/for-elasticsearch-docs/docs/sql/datatypes/#date-and-time-types
...
By default, the Elasticsearch DSL uses the date type as the only date-time related type that contains all information of an absolute time point.
...
For the SQL endpoint, we can use date functions that will return other date/time types out of them
* master: fix: UI toast typo (apache#13026) feat(db engines): add support for Opendistro Elasticsearch (AWS ES) (apache#12602) fix(build): black failing on master, add to required checks (apache#13039) fix: time filter db migration optimization (apache#13015) fix: untranslated text content of Dashboard page (apache#13024) fix(ci): remove signature requirements for commits to master (apache#13034) fix: add alerts and report to default config (apache#12999) docs(changelog): add entries for 1.0.1 (apache#12981) ci: skip cypress if no code changes (apache#12982) chore: add cypress required checks for branch protection (apache#12970) Refresh dashboard list after bulk delete (apache#12945) Updates storybook to version 6.1.17 (apache#13014) feat: Save datapanel state in local storage (apache#12996) fix: added text and changed margins (apache#12923) chore: Swap Slack Url 2 more places (apache#13004)
…pache#12602) * feat(db engines): add support for Opendistro Elasticsearch (AWS ES) * add time grains * lint * bump elasticsearch-dbapi version * add tests * fix test
|
@villebro When do you plan to release a new version with this improvement ? |
…pache#12602) * feat(db engines): add support for Opendistro Elasticsearch (AWS ES) * add time grains * lint * bump elasticsearch-dbapi version * add tests * fix test (cherry picked from commit b3a814f)
…pache#12602) * feat(db engines): add support for Opendistro Elasticsearch (AWS ES) * add time grains * lint * bump elasticsearch-dbapi version * add tests * fix test
SUMMARY
Adds Elasticsearch opendistro support. Most work was done upstream on the release of
elasticsearch-dbapi0.2.0.Checkout https://github.com/preset-io/elasticsearch-dbapi/blob/master/README.md for more details.
ADDITIONAL INFORMATION