Skip to content

Comments

fix(26338): replace chartsInScope references at import time#26389

Draft
rdubois-kh wants to merge 3 commits intoapache:masterfrom
rdubois-kh:rdubois/fix/26338/fix-charts-in-scope-references
Draft

fix(26338): replace chartsInScope references at import time#26389
rdubois-kh wants to merge 3 commits intoapache:masterfrom
rdubois-kh:rdubois/fix/26338/fix-charts-in-scope-references

Conversation

@rdubois-kh
Copy link

SUMMARY

See the description here: #26338

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
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

Copy link
Member

@john-bodley john-bodley left a comment

Choose a reason for hiding this comment

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

Thanks @rdubois-kh for the fix.

@betodealmeida @hughhhh et al. would you mind reviewing this? Sadly I don't have much context on the import/export logic.

]

charts_in_scope = native_filter.get("chartsInScope", [])
if charts_in_scope:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if charts_in_scope:
if charts_in_scope := native_filter.get("chartsInScope", []):

Copy link
Member

Choose a reason for hiding this comment

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

@rdubois-kh curious your take on the suggestion, and @john-bodley wondering if you see this as blocking.

Copy link
Author

Choose a reason for hiding this comment

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

@rusackas thanks for the heads-up. I took the suggestion into account in this 1fab897

@codecov
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (29633e7) 69.14% compared to head (c6732c4) 69.14%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26389      +/-   ##
==========================================
- Coverage   69.14%   69.14%   -0.01%     
==========================================
  Files        1946     1946              
  Lines       75989    75992       +3     
  Branches     8479     8479              
==========================================
+ Hits        52544    52546       +2     
- Misses      21266    21267       +1     
  Partials     2179     2179              
Flag Coverage Δ
hive 53.68% <0.00%> (-0.01%) ⬇️
mysql 78.07% <0.00%> (+0.01%) ⬆️
postgres 78.16% <0.00%> (-0.01%) ⬇️
presto 53.63% <0.00%> (-0.01%) ⬇️
python 82.86% <100.00%> (-0.01%) ⬇️
sqlite 76.82% <0.00%> (-0.01%) ⬇️
unit 55.80% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rusackas
Copy link
Member

Closing/reopening to kick-start CI. Also, @betodealmeida if you could review or nominate someone else, we'd appreciate it!

@rusackas rusackas closed this Apr 18, 2024
@rusackas rusackas reopened this Apr 18, 2024
@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.14%. Comparing base (29633e7) to head (c6732c4).
Report is 781 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26389      +/-   ##
==========================================
- Coverage   69.14%   69.14%   -0.01%     
==========================================
  Files        1946     1946              
  Lines       75989    75992       +3     
  Branches     8479     8479              
==========================================
+ Hits        52544    52546       +2     
- Misses      21266    21267       +1     
  Partials     2179     2179              
Flag Coverage Δ
hive 53.68% <0.00%> (-0.01%) ⬇️
mysql 78.07% <0.00%> (+0.01%) ⬆️
postgres 78.16% <0.00%> (-0.01%) ⬇️
presto 53.63% <0.00%> (-0.01%) ⬇️
python 82.86% <100.00%> (-0.01%) ⬇️
sqlite 76.82% <0.00%> (-0.01%) ⬇️
unit 55.80% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rusackas
Copy link
Member

@eschutho / @betodealmeida still hoping someone with more context on import/export can help review this :)

@pull-request-size pull-request-size bot added size/L and removed size/M labels Apr 26, 2024
@rdubois-kh
Copy link
Author

All, as mentioned in #26338, a new commit has been added to the PR to make the charts references fix more complete as I missed a couple of locations where references were not updated at import time.

I guess the PR is re-ready for being reviewed. Thanks in advance.

@rusackas
Copy link
Member

Looks like this will need a rebase... hopefully we can get it to pass CI, and get this across the finish line finally.

@rusackas
Copy link
Member

/korbit-review

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Fix Detected
Readability Incorrect use of double underscore prefix ▹ view
Files scanned
File Path Reviewed
superset/commands/dashboard/importers/v1/utils.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • On any given comment that Korbit raises on your pull request, you can have a discussion with Korbit by replying to the comment.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Documentation
Logging
Error Handling
Readability
Design
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

Comment on lines +60 to +62
def __fix_charts_references_in_scope(
configuration: dict[str, Any], charts_map: dict[int, int]
) -> dict[str, Any]:
Copy link

Choose a reason for hiding this comment

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

Incorrect use of double underscore prefix category Readability

Tell me more
What is the issue?

Function name uses double underscores which in Python implies name mangling, but this is not a class method where that would be appropriate.

Why this matters

Double underscores can make the function harder to import/reference and suggest private class method behavior when this is just a module-level utility function.

Suggested change ∙ Feature Preview
def _fix_charts_references_in_scope(
    configuration: dict[str, Any], charts_map: dict[int, int]
) -> dict[str, Any]:
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

@rusackas
Copy link
Member

This PR hasn't been updated in a long time and is in need of a rebase. We'll mark it as draft, but please set it as 'ready for review' when it's been brought up to speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants