-
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
feat: add export_related flag #19215
feat: add export_related flag #19215
Conversation
Codecov Report
@@ Coverage Diff @@
## master #19215 +/- ##
==========================================
- Coverage 66.55% 66.53% -0.03%
==========================================
Files 1646 1646
Lines 63632 63637 +5
Branches 6476 6476
==========================================
- Hits 42353 42341 -12
- Misses 19597 19614 +17
Partials 1682 1682
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -43,7 +43,7 @@ class ExportChartsCommand(ExportModelsCommand): | |||
not_found = ChartNotFoundError | |||
|
|||
@staticmethod | |||
def _export(model: Slice) -> Iterator[Tuple[str, str]]: | |||
def _export(model: Slice, export_related: bool = True) -> Iterator[Tuple[str, str]]: |
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.
nit: i like export_dependencies
instead of related
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 used related
to keep the same terminology used by FAB, and also because some of these are not technically dependencies (eg, when we export a database you also get the datasets, though they're not dependencies).
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
1307480
to
91e9831
Compare
* feat: add export_related flag * Fix lint (cherry picked from commit d01fdad)
SUMMARY
This PR introduces a new flag
export_related
to the export commands (databases, datasets, charts, dashboards, saved queries). Usually, when a dataset is exported it will also export its database; when a dashboard is exported, the export will also contain associated charts, datasets, and databases; and so on. When the flag is changed from its default value ofTrue
then only the asset itself will be exported, without any associated assets.This PR is in preparation for creating a command that will export all assets from a given Superset workspace, allowing us to move the configuration to source control.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
Added unit tests for each of the models.
ADDITIONAL INFORMATION