-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(druid): Remove legacy Druid NoSQL logic #23997
chore(druid): Remove legacy Druid NoSQL logic #23997
Conversation
d6ea0db
to
c7cf36a
Compare
@@ -230,8 +230,6 @@ def pivot_table_v2( | |||
Pivot table v2. | |||
""" | |||
verbose_map = datasource.data["verbose_map"] if datasource else None | |||
if form_data.get("granularity_sqla") == "all" and DTTM_ALIAS in df: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is likely a bug (see like #259), i.e., it likely should have been granularity
rather than granularity_sqla
as this represents the Druid NoSQL time grain (as opposed to the SQL time column) where all
is a Druid NoSQL concept which represents a single time grain/bucket to encapsulate the entire time range.
# [TimeZone List] | ||
# See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | ||
# other tz can be overridden by providing a local_config | ||
DRUID_TZ = tz.tzutc() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were all unused.
@@ -372,9 +372,7 @@ def query_obj(self) -> QueryObjectDict: # pylint: disable=too-many-locals | |||
del groupby[groupby_labels.index(DTTM_ALIAS)] | |||
is_timeseries = True | |||
|
|||
granularity = self.form_data.get("granularity") or self.form_data.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat concerning as these terms mean different things in the form-data. Clearly a byproduct of extremely poorly named and confusing variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, good reminder to NEVER have dual meanings for variables.
@@ -1188,11 +1180,7 @@ def query_obj(self) -> QueryObjectDict: | |||
"month": "P1M", | |||
"year": "P1Y", | |||
} | |||
time_grain = mapping[self.form_data.get("subdomain_granularity", "min")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now inlined.
cd2ccaf
to
2bfa10f
Compare
9a15940
to
97d27f8
Compare
Codecov Report
@@ Coverage Diff @@
## master #23997 +/- ##
=======================================
Coverage 69.08% 69.08%
=======================================
Files 1905 1905
Lines 74848 74810 -38
Branches 8108 8107 -1
=======================================
- Hits 51705 51684 -21
+ Misses 21031 21015 -16
+ Partials 2112 2111 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
f9bb97e
to
7a3b045
Compare
7a3b045
to
963f436
Compare
963f436
to
e489a1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few first pass comments. My comments regarding granularity
may be baseless, but if needed I can double check by doing some testing, as I think a few of these should not be removed.
docs/static/resources/openapi.json
Outdated
"granularity": { | ||
"description": "Name of temporal column used for time filtering. For legacy Druid datasources this defines the time grain.", | ||
"nullable": true, | ||
"type": "string" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have trouble wrapping my head around these different granularities and when they're in the main payload vs extras, but shouldn't this still be here, only without the reference to legacy Druid? I looked at the QueryObject
class, and granularity
still seems to be featured in the constructor/property list.
Alternatively, do we need to update line 1367 which states that granularity_sqla
"is deprecated, use granularity
instead."?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@villebro you're right and I've reverted the deletion. There is already a comment stating that granularity_sqla
is deprecated.
@@ -34,7 +34,6 @@ | |||
|
|||
from superset.common.chart_data import ChartDataResultFormat | |||
from superset.utils.core import ( | |||
DTTM_ALIAS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always thrilled to see the removal of a DTTM_ALIAS
reference 🙂
@@ -372,9 +372,7 @@ def query_obj(self) -> QueryObjectDict: # pylint: disable=too-many-locals | |||
del groupby[groupby_labels.index(DTTM_ALIAS)] | |||
is_timeseries = True | |||
|
|||
granularity = self.form_data.get("granularity") or self.form_data.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, good reminder to NEVER have dual meanings for variables.
e489a1b
to
6af08eb
Compare
Thanks @villebro for the review. I've addressed your comments. @michael-s-molina and @villebro will the whole |
6af08eb
to
9d83f20
Compare
@villebro I've addressed your comments. Would you mind re-reviewing the PR? |
9d83f20
to
a36e933
Compare
a36e933
to
51b6af6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic job @john-bodley! Really reduced the complexity. I left just one comment for a field that may be removed.
@@ -1159,10 +1151,7 @@ class Meta: # pylint: disable=too-few-public-methods | |||
) | |||
filters = fields.List(fields.Nested(ChartDataFilterSchema), allow_none=True) | |||
granularity = fields.String( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't granularity
be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this! 🔥 🔥 🔥 🔥 🔥
"description": "Name of temporal column used for time filtering. " | ||
"For legacy Druid datasources this defines the time grain." | ||
}, | ||
metadata={"description": "Name of temporal column used for time filtering. "}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michael-s-molina I believe your question is somewhat akin to the conversation with @villebro where the term "granularity" is overloaded. Per the augmented description
you can see it referred to the time gran for Druid NoSQL connector (which is now obsolete), however it also is used to represent the temporal time column for the SQL connector.
SUMMARY
This PR addresses Superset 3.0 task #11 by removing the remaining legacy Druid NoSQL logic which was removed in Superset 2.0. Specifically it primarily removes form-data keys including:
druid_time_origin
having_druid
having_filters
*granularity
*** This represents SIMPLE, i.e., non-SQL, having filters which were only supported with the Druid NoSQL connector.
** This term is used inappropriately and represents either the Druid NoSQL time granularity or the SQL time column (an alias for
granularity_sqla
used in the query context and frontend). Differentiating between the two is somewhat of a challenge.Note this PR leaves the
Slice.datasource_type
column (and associated logic) as is—which was primarily used to differentiate between the SQL and Druid NoSQL connectors—as it isn't officially deprecated and maybe used to currently (or in the future) for ad-hoc query based datasets (or similar).BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
DRUID
and the various form-data keys.ADDITIONAL INFORMATION