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: Remove obsolete legacy visualizations #24694

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Jul 14, 2023

SUMMARY

@michael-s-molina apologies for all the churn, but I'm unable to re-open #24671 in GitHub as the branch has been forced pushed after the PR was closed.

Delving a little deeper into the annotation logic I was able to rework the logic in said PR in order for the Cypress tests to pass., i.e., this PR is a superset (no pun intended) of #24671 . Thankfully means that we're able to remove the TableViz visualization type which simplifies the visualization logic, i.e., now every chart is defined as either a legacy chart or a non-legacy chart but not both.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI.

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

@john-bodley john-bodley force-pushed the john-bodley--chore-remove-obsolete-legacy-viz branch from 73e55ca to 1163f6d Compare July 14, 2023 05:03
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #24694 (9eec52f) into master (0328dd2) will decrease coverage by 0.08%.
The diff coverage is 7.40%.

❗ Current head 9eec52f differs from pull request most recent head 155c6a8. Consider uploading reports for the commit 155c6a8 to get more accurate results

@@            Coverage Diff             @@
##           master   #24694      +/-   ##
==========================================
- Coverage   68.97%   68.89%   -0.08%     
==========================================
  Files        1901     1901              
  Lines       74008    73927      -81     
  Branches     8183     8183              
==========================================
- Hits        51047    50932     -115     
- Misses      20840    20874      +34     
  Partials     2121     2121              
Flag Coverage Δ
hive 54.15% <7.40%> (+0.03%) ⬆️
mysql 79.21% <7.40%> (-0.15%) ⬇️
postgres 79.29% <7.40%> (-0.15%) ⬇️
presto 54.05% <7.40%> (+0.03%) ⬆️
python 83.31% <7.40%> (-0.14%) ⬇️
sqlite 77.88% <7.40%> (-0.15%) ⬇️
unit 54.87% <7.40%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
superset/examples/birth_names.py 69.69% <ø> (ø)
superset/viz.py 64.51% <ø> (-2.39%) ⬇️
superset/common/query_context_processor.py 85.13% <7.40%> (-4.83%) ⬇️

... and 2 files with indirect coverage changes

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

@john-bodley john-bodley force-pushed the john-bodley--chore-remove-obsolete-legacy-viz branch from 1163f6d to 9e5b773 Compare July 14, 2023 06:11
)
payload = viz_obj.get_payload()
return payload["data"]
if chart.viz_type in viz_types:
Copy link
Member Author

Choose a reason for hiding this comment

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

Same logic was previously but indented.

query_object.extras["time_grain_sqla"] = time_grain_sqla

if time_range := overrides.get("time_range"):
from_dttm, to_dttm = get_since_until_from_time_range(time_range)
Copy link
Member Author

Choose a reason for hiding this comment

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

The QueryObject has both time_range and (from_dttm, to_dttm) but I was only able to get the annotation override to adhere to the later.

@john-bodley john-bodley marked this pull request as ready for review July 14, 2023 06:20
@john-bodley john-bodley force-pushed the john-bodley--chore-remove-obsolete-legacy-viz branch 2 times, most recently from e156bb8 to 20662cc Compare July 14, 2023 21:31
@john-bodley john-bodley force-pushed the john-bodley--chore-remove-obsolete-legacy-viz branch from 20662cc to 155c6a8 Compare July 15, 2023 04:38
@@ -424,6 +424,16 @@ def create_slices(tbl: SqlaTable) -> tuple[list[Slice], list[Slice]]:
viz_type="table",
metrics=metrics,
),
query_context=get_slice_json(
Copy link
Member Author

Choose a reason for hiding this comment

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

@michael-s-molina even though you were able to run the Celery tests locally without issue, after a few tweaks (increasing timeouts to address the performance degradation on M1 silica) I was able to see the following error:

Screenshot 2023-07-14 at 8 10 46 PM

I don't fully grok where/when the query context is persisted (the only place I could see where the query context was generated from the payload/form-data was via the /api/chart/v1//data/ RESTful API GET endpoint), but it does seem the existence of query context seemed somewhat sporadic. Maybe @villebro can provide more insights in terms of how/where this is generated/persisted as in the example data currently only the "Pivot Table v2" chart (per the slices.query_context column) has the query context explicitly defined yet there are swaths of non-legacy charts.

The TL;DR is similar to the "Pivot Table v2" chart when I explicitly added the query context for the "Daily Totals" chart (which backs the annotation layer in the Cypress test which was failing) the test passed.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for the cleanup.

@john-bodley john-bodley merged commit 1b5a679 into apache:master Jul 18, 2023
@michael-s-molina michael-s-molina added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jul 19, 2023
michael-s-molina pushed a commit that referenced this pull request Jul 26, 2023
john-bodley added a commit to john-bodley/superset that referenced this pull request Aug 2, 2023
michael-s-molina pushed a commit that referenced this pull request Aug 4, 2023
@mistercrunch mistercrunch added 🍒 3.0.4 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 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/XL v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants