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

feat: deprecate /superset/extra_table_metadata migrate to api v1 #19921

Conversation

dpgaspar
Copy link
Member

@dpgaspar dpgaspar commented May 2, 2022

SUMMARY

Following plan to gradually deprecate "REST" endpoints on /superset namespace.

Deprecates /superset/extra_table_metadata/<int:database_id>/<table_name>/<schema>/. Proposed removal on Superset 3.0

New endpoint /api/v1/database/<int:database_id>/table_extra/<table_name>/<schema_name>/

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

@codecov
Copy link

codecov bot commented May 2, 2022

Codecov Report

Merging #19921 (db431f5) into master (aff10a7) will decrease coverage by 12.55%.
The diff coverage is 52.45%.

❗ Current head db431f5 differs from pull request most recent head 5e0ee01. Consider uploading reports for the commit 5e0ee01 to get more accurate results

@@             Coverage Diff             @@
##           master   #19921       +/-   ##
===========================================
- Coverage   66.52%   53.97%   -12.56%     
===========================================
  Files        1714     1714               
  Lines       65052    65099       +47     
  Branches     6722     6725        +3     
===========================================
- Hits        43279    35139     -8140     
- Misses      20061    28248     +8187     
  Partials     1712     1712               
Flag Coverage Δ
hive 52.90% <39.74%> (-0.01%) ⬇️
mysql ?
postgres ?
presto 52.76% <39.74%> (+<0.01%) ⬆️
python 56.80% <52.56%> (-25.61%) ⬇️
sqlite ?
unit 48.06% <42.30%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
...ns/legacy-plugin-chart-heatmap/src/controlPanel.ts 66.66% <ø> (ø)
.../legacy-plugin-chart-histogram/src/controlPanel.ts 60.00% <ø> (ø)
...gins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx 100.00% <ø> (ø)
...frontend/plugins/plugin-chart-echarts/src/types.ts 100.00% <ø> (ø)
superset-frontend/src/SqlLab/actions/sqlLab.js 60.39% <ø> (ø)
superset-frontend/src/SqlLab/reducers/sqlLab.js 33.15% <ø> (ø)
...rset-frontend/src/dashboard/util/findPermission.ts 92.30% <ø> (ø)
superset-frontend/src/embedded/index.tsx 0.00% <0.00%> (ø)
...nd/src/explore/components/DataTablesPane/index.tsx 71.55% <ø> (ø)
...nts/ExploreAdditionalActionsMenu/ExploreReport.tsx 57.89% <ø> (ø)
... and 314 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aff10a7...5e0ee01. Read the comment docs.

@@ -775,10 +775,30 @@ def test_get_invalid_table_table_metadata(self):
Database API: Test get invalid table from table metadata
"""
example_db = get_example_database()
uri = f"api/v1/database/{example_db.id}/wrong_table/null/"
uri = f"api/v1/database/{example_db.id}/table/wrong_table/null/"
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch!

@@ -415,10 +415,10 @@ describe('async actions', () => {
fetchMock.delete(updateTableSchemaEndpoint, {});
fetchMock.post(updateTableSchemaEndpoint, JSON.stringify({ id: 1 }));

const getTableMetadataEndpoint = 'glob:*/api/v1/database/*';
const getTableMetadataEndpoint = 'glob:**/api/v1/database/*/table/*/*/';
Copy link
Member

Choose a reason for hiding this comment

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

isn't a single asterisk here sufficient?

Suggested change
const getTableMetadataEndpoint = 'glob:**/api/v1/database/*/table/*/*/';
const getTableMetadataEndpoint = 'glob:*/api/v1/database/*/table/*/*/';

fetchMock.get(getTableMetadataEndpoint, {});
const getExtraTableMetadataEndpoint =
'glob:*/superset/extra_table_metadata/*';
'glob:**/api/v1/database/*/table_extra/*/*/';
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Suggested change
'glob:**/api/v1/database/*/table_extra/*/*/';
'glob:*/api/v1/database/*/table_extra/*/*/';

@dpgaspar dpgaspar merged commit 4fdf230 into apache:master May 4, 2022
@dpgaspar dpgaspar deleted the danielgaspar/sc-42066/migrate-superset-extra-table-metadata-database branch May 4, 2022 13:55
jasonvank pushed a commit to CarbonEdge2021/superset that referenced this pull request May 4, 2022
…che#19921)

* feat: deprecate /superset/extra_table_metadata migrate to api v1

* use can_read to table_extra_metadata

* troubleshoot sqlite

* fix test

* fix test

* fix test

* fix frontend test on sqllab
jasonvank pushed a commit to CarbonEdge2021/superset that referenced this pull request May 4, 2022
…che#19921)

* feat: deprecate /superset/extra_table_metadata migrate to api v1

* use can_read to table_extra_metadata

* troubleshoot sqlite

* fix test

* fix test

* fix test

* fix frontend test on sqllab
hughhhh pushed a commit to hve-labs/superset that referenced this pull request May 11, 2022
…che#19921)

* feat: deprecate /superset/extra_table_metadata migrate to api v1

* use can_read to table_extra_metadata

* troubleshoot sqlite

* fix test

* fix test

* fix test

* fix frontend test on sqllab
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
…che#19921)

* feat: deprecate /superset/extra_table_metadata migrate to api v1

* use can_read to table_extra_metadata

* troubleshoot sqlite

* fix test

* fix test

* fix test

* fix frontend test on sqllab
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 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 preset-io size/L 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants