-
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: Remove obsolete legacy visualizations #24675
chore: Remove obsolete legacy visualizations #24675
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24675 +/- ##
==========================================
- Coverage 68.97% 68.91% -0.07%
==========================================
Files 1902 1902
Lines 74007 73909 -98
Branches 8186 8186
==========================================
- Hits 51047 50931 -116
- Misses 20839 20857 +18
Partials 2121 2121
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
0888b3c
to
612c971
Compare
@@ -46,7 +46,7 @@ def test_no_data_cache(self): | |||
app.config["DATA_CACHE_CONFIG"] = {"CACHE_TYPE": "NullCache"} | |||
cache_manager.init_app(app) | |||
|
|||
slc = self.get_slice("Girls", db.session) | |||
slc = self.get_slice("Top 10 Girl Name Share", db.session) |
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.
Switching out for a legacy chart which invokes the /superset/explore_json
RESTful API endpoint.
a04d32e
to
6b3902c
Compare
@@ -1715,7 +1715,7 @@ def test_gets_owned_created_favorited_by_me_filter(self): | |||
) | |||
def test_warm_up_cache(self): | |||
self.login() | |||
slc = self.get_slice("Girls", db.session) | |||
slc = self.get_slice("Top 10 Girl Name Share", db.session) |
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.
Currently caching only works with legacy charts and removal of the TableViz
now treats the Girls
chart as a non-legacy chart. One could argue this is a regression—in terms of fewer charts being eligible for caching—but the problem will be rectified in #24671.
6b3902c
to
eea28c3
Compare
@@ -73,7 +73,7 @@ def test_slice_data_cache(self): | |||
} | |||
cache_manager.init_app(app) | |||
|
|||
slc = self.get_slice("Boys", db.session) | |||
slc = self.get_slice("Top 10 Girl Name Share", db.session) |
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.
See previous comment.
@@ -391,7 +393,7 @@ def test_databaseview_edit(self, username="admin"): | |||
) | |||
def test_warm_up_cache(self): | |||
self.login() | |||
slc = self.get_slice("Girls", db.session) | |||
slc = self.get_slice("Top 10 Girl Name Share", db.session) |
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.
See previous comment.
@@ -418,10 +420,10 @@ def test_cache_logging(self): | |||
self.login("admin") | |||
store_cache_keys = app.config["STORE_CACHE_KEYS_IN_METADATA_DB"] | |||
app.config["STORE_CACHE_KEYS_IN_METADATA_DB"] = True | |||
girls_slice = self.get_slice("Girls", db.session) | |||
self.get_json_resp(f"/superset/warm_up_cache?slice_id={girls_slice.id}") | |||
slc = self.get_slice("Top 10 Girl Name Share", db.session) |
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.
See previous comment.
@@ -1680,7 +1680,7 @@ def test_raise_for_access_table(self, mock_can_access): | |||
def test_raise_for_access_viz( | |||
self, mock_can_access_schema, mock_can_access, mock_is_owner | |||
): | |||
test_viz = viz.TableViz(self.get_datasource_mock(), form_data={}) | |||
test_viz = viz.TimeTableViz(self.get_datasource_mock(), form_data={}) |
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.
Any legacy viz type works.
@@ -45,7 +45,7 @@ def test_constructor_exception_no_datasource(self): | |||
viz.BaseViz(datasource, form_data) | |||
|
|||
def test_process_metrics(self): | |||
# test TableViz metrics in correct order | |||
# test TimeTableViz metrics in correct order |
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.
Any legacy viz type should work.
eea28c3
to
ac7761a
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.
LGTM. Thanks for the cleanup.
Closing in favor of #24692. |
SUMMARY
Whilst working on #24671 I realize that some non-legacy charts (which are invoked via the
/api/v1/chart
RESTful API endpoint) are still present insuperset.viz
meaning the logic outlined in said PR for differentiating between legacy and non-legacy charts was incorrect.This PR removes the following charts (which were marked as deprecated in 3.0 though in actuality were obsolete):
TableViz
BigNumberViz
BigNumberTotalViz
which will ensure that the logic in #24671 will be correct.
Technically (as illustrated by the augmented tests) these visualization types could be invoked either using the legacy or non-legacy RESTful API endpoint, though in actuality (per the frontend logic) they would only ever be invoked under the later.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
I systematically went through all the visualization types in
superset/viz.py
(all NVD3 and DeckGL charts were bucketed together) and inspected which RESTful API endpoint was being invoked, i.e., any chart using the RESTful/superset/explore_json
endpoint (or similar) remained.ADDITIONAL INFORMATION