-
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: removing Druid from front- and back- end #20338
chore: removing Druid from front- and back- end #20338
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20338 +/- ##
==========================================
+ Coverage 66.84% 66.86% +0.02%
==========================================
Files 1754 1753 -1
Lines 65731 65664 -67
Branches 6950 6921 -29
==========================================
- Hits 43940 43909 -31
+ Misses 20028 19997 -31
+ Partials 1763 1758 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
4ae9553
to
c37253c
Compare
...c/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx
Outdated
Show resolved
Hide resolved
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.
looking good so far.. thanks @AAfghahi!
894428b
to
4ef250e
Compare
{ | ||
expressionType: 'SIMPLE', | ||
clause: 'HAVING', | ||
subject: 'sweetness', | ||
operator: '>', | ||
comparator: '0', | ||
}, | ||
{ | ||
expressionType: 'SIMPLE', | ||
clause: 'HAVING', | ||
subject: 'sweetness', | ||
operator: '<=', | ||
comparator: '50', | ||
}, |
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.
Are these Druid specific?
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 think so, because it maps to a field called DRUID_ONLY_OPERATORS
however they seem like relatively normal operators to have.
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.
Ah, right, I think expressionType=SIMPLE
is Druid-only.
return !( | ||
(props.datasource.type === 'druid' && | ||
TABLE_ONLY_OPERATORS.indexOf(operator) >= 0) || | ||
(props.datasource.type === 'table' && | ||
DRUID_ONLY_OPERATORS.indexOf(operator) >= 0) || | ||
(props.adhocFilter.clause === CLAUSES.HAVING && | ||
HAVING_OPERATORS.indexOf(operator) === -1) | ||
props.adhocFilter.clause === CLAUSES.HAVING && | ||
HAVING_OPERATORS.indexOf(operator) === -1 |
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.
Might be cleaner to write as:
return (
props.adhocFilter.clause !== CLAUSES.HAVING ||
HAVING_OPERATORS.indexOf(operator) !== -1
);
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 like that thank you!
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.
You can always replace !(a && b)
with !a || !b
, and in this case I think it makes it easier to follow the logic.
rejected.append( | ||
{ | ||
"reason": ExtraFiltersReasonType.NOT_DRUID_DATASOURCE, | ||
"column": ExtraFiltersTimeColumnType.GRANULARITY, | ||
} | ||
) |
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.
We should keep this, no?
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.
just the else?
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.
Right, the else
.
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.
Or maybe not, ExtraFiltersReasonType.NOT_DRUID_DATASOURCE
suggests that this whole part of the code is Druid only.
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.
Thinking about it more, I feel as though these two are pretty druid specific.
superset/utils/core.py
Outdated
# This seems like it is to do with the druid time series, which I think we | ||
# are still keeping mentions of. |
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.
Can you clarify this?
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.
Yes! This was a misunderstanding from earlier today. I thought that we were keeping druid_time_origin
and we are not.
7e20efc
to
5970ca3
Compare
@@ -23,7 +23,7 @@ import { TimeGranularity } from '../time-format'; | |||
|
|||
export default function extractTimegrain( | |||
formData: QueryFormData, | |||
): TimeGranularity | undefined { | |||
): TimeGranularity | undefined | 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 am not excited about changing this to include strings, even though it seems to be pretty 50/50 in the codebase. Is it worth to go through and refactor the string portions @eschutho
21b18d0
to
4957d61
Compare
superset-frontend/src/explore/controlUtils/standardizedFormData.test.tsx
Outdated
Show resolved
Hide resolved
/testenv up |
@AAfghahi Ephemeral environment spinning up at http://35.89.28.211:8080. Credentials are |
superset-frontend/src/explore/controlUtils/getSectionsToRender.ts
Outdated
Show resolved
Hide resolved
9cf6d6a
to
9241875
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.
code looks good. Thanks @AAfghahi! Let's see if @jinghua-qa is available to QA before merging.
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.
Thanks for the hard work. This PR makes a lot of work easier.
superset-frontend/packages/superset-ui-core/src/query/types/QueryFormData.ts
Outdated
Show resolved
Hide resolved
expect(isSavedMetric(adhocMetricSQL)).toEqual(false); | ||
expect(isSavedMetric(null)).toEqual(false); | ||
expect(isSavedMetric(undefined)).toEqual(false); | ||
expect(isSavedMetric(adhocMetricSQL as QueryFormMetric)).toEqual(false); | ||
expect(isSavedMetric(null as unknown as QueryFormMetric)).toEqual(false); | ||
expect(isSavedMetric(undefined as unknown as QueryFormMetric)).toEqual(false); |
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.
the type of argument(metric) is any, so no needs as QueryFormMetric
export function isSavedMetric(metric: any): metric is SavedMetric {
return typeof metric === 'string';
}
@@ -19,10 +19,8 @@ | |||
export * from './Datasource'; | |||
export * from './Column'; | |||
export * from './Filter'; | |||
export * from './Metric'; |
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.
should keep this line.
superset-frontend/packages/superset-ui-core/src/query/types/index.ts
Outdated
Show resolved
Hide resolved
566505d
to
460cbdf
Compare
…-nosql-from-the-codebase
c9fd6b3
to
4be9f7e
Compare
/testenv up |
@AAfghahi Ephemeral environment spinning up at http://35.89.191.195:8080. Credentials are |
QA tested and verified. LGTM |
Ephemeral environment shutdown and build artifacts deleted. |
* first pass at removing native Druid nosql * removing having_druid * addressing comments, linting * fixed all tests * addressing comments * redirected to ui-core TimeGranularity type * query form metric linting * fixed broken chart type * implementing feedback
SUMMARY
This is the first pass at the Druid specific conditionals.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION