-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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: Adds chart IDs option to migrate-viz #29361
feat: Adds chart IDs option to migrate-viz #29361
Conversation
a71cfeb
to
09e5d2f
Compare
09e5d2f
to
1537e20
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #29361 +/- ##
==========================================
+ Coverage 60.48% 70.34% +9.85%
==========================================
Files 1931 1961 +30
Lines 76236 78477 +2241
Branches 8568 8961 +393
==========================================
+ Hits 46114 55204 +9090
+ Misses 28017 21076 -6941
- Partials 2105 2197 +92
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
1537e20
to
2fe65a8
Compare
Two small functional suggestions:
|
superset/cli/viz_migrations.py
Outdated
) | ||
def upgrade(viz_type: str) -> None: | ||
def upgrade(viz_type: str, chart_id: int | None = None) -> None: |
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.
Should this be something which can be specified multiple times? Also I wonder if --chart
would be suffice, i.e., it's somewhat implicit that you would be specifying the chart ID.
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.
Actually given the context (migrating a visualisation) maybe --id
would make more sense and be more in line with -t
for viz type.
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.
I updated the description with:
--ids TEXT A comma separated list of chart IDs to downgrade
Great suggestions. I did both. |
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
superset/cli/viz_migrations.py
Outdated
) | ||
def upgrade(viz_type: str) -> None: | ||
@optgroup.option( | ||
"-ids", |
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.
Shouldn't this have two dashes rather than one? Also why not use the multiple options --id 1 --id 2 ...
so that way you don't need to split a string and the types will be correct, i.e., the following will correctly fail during the validation phase:
--id 1 --id foo
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.
Change it to use double dashes 👍🏼
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.
Change it to use a multi-value parameter --id
ad483f6
to
e5fec0d
Compare
e5fec0d
to
98cb635
Compare
98cb635
to
0eb50d8
Compare
SUMMARY
Adds the optional
chart_id
parameter to themigrate-viz
command to allow upgrading/downgrading a specific chart.TESTING INSTRUCTIONS
Check that you can upgrade/downgrade a specific chart using the
-id
option.ADDITIONAL INFORMATION