Skip to content
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(superset-ui): remove deprecated fields from QueryObject #22272

Merged

Conversation

villebro
Copy link
Member

@villebro villebro commented Nov 30, 2022

SUMMARY

Remove the following fields from buildQueryObject, as they raise annoying deprecation warnings on /api/v1/chart/data (these are also updated in the relevant chart plugins):

  • limit -> replace with series_limit
  • timeseries_limit_metric -> replace with series_limit_metric

Also fix the incorrect type of series_limit_metric, also fixing the normalizeSeriesLimitMetric function which was incorrect due to the incorrect type, and replace some groupby props with columns in some native filters that were also raising warnings. Finally add some missing tests that caught my eye.

Functionally this PR shouldn't change anything, as these fields are already converted into their non-deprecated counterparts here:

DEPRECATED_FIELDS = (
DeprecatedField(old_name="granularity_sqla", new_name="granularity"),
DeprecatedField(old_name="groupby", new_name="columns"),
DeprecatedField(old_name="timeseries_limit", new_name="series_limit"),
DeprecatedField(old_name="timeseries_limit_metric", new_name="series_limit_metric"),
)
, so it should be minimal risk.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup. I really appreciate you removing such confusing fields in the QueryObject.

@codecov
Copy link

codecov bot commented Nov 30, 2022

Codecov Report

Merging #22272 (8e74d32) into master (a642d12) will decrease coverage by 0.02%.
The diff coverage is 77.77%.

@@            Coverage Diff             @@
##           master   #22272      +/-   ##
==========================================
- Coverage   66.86%   66.83%   -0.03%     
==========================================
  Files        1841     1841              
  Lines       70220    70221       +1     
  Branches     7670     7672       +2     
==========================================
- Hits        46950    46935      -15     
- Misses      21282    21302      +20     
+ Partials     1988     1984       -4     
Flag Coverage Δ
javascript 53.66% <77.77%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...packages/superset-ui-core/src/query/types/Query.ts 100.00% <ø> (ø)
...ugins/plugin-chart-echarts/src/Radar/buildQuery.ts 0.00% <0.00%> (ø)
...rontend/src/filters/components/Range/buildQuery.ts 0.00% <ø> (ø)
...ontend/src/filters/components/Select/buildQuery.ts 90.00% <ø> (ø)
...ges/superset-ui-core/src/query/buildQueryObject.ts 100.00% <100.00%> (ø)
...ges/superset-ui-core/src/query/normalizeOrderBy.ts 100.00% <100.00%> (ø)
...rd/components/nativeFilters/FilterBar/keyValue.tsx 18.51% <0.00%> (-22.23%) ⬇️
...board/components/nativeFilters/FilterBar/index.tsx 50.00% <0.00%> (-8.89%) ⬇️
...ilters/FilterBar/FilterControls/FilterControls.tsx 70.21% <0.00%> (-2.13%) ⬇️
...d/components/DashboardBuilder/DashboardBuilder.tsx 74.28% <0.00%> (-0.96%) ⬇️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@villebro villebro merged commit b1f8fd4 into apache:master Nov 30, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants