-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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!: turn on Versioned Export in config.py #19142
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -407,7 +407,7 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]: | |
"DASHBOARD_NATIVE_FILTERS_SET": False, | ||
"DASHBOARD_FILTERS_EXPERIMENTAL": False, | ||
"GLOBAL_ASYNC_QUERIES": False, | ||
"VERSIONED_EXPORT": False, | ||
"VERSIONED_EXPORT": True, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ |
||
# Note that: RowLevelSecurityFilter is only given by default to the Admin role | ||
# and the Admin Role does have the all_datasources security permission. | ||
# But, if users create a specific role with access to RowLevelSecurityFilter MVC | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,9 @@ def assert_cli_fails_properly(response, caplog): | |
assert caplog.records[-1].levelname == "ERROR" | ||
|
||
|
||
@mock.patch.dict( | ||
"superset.cli.lib.feature_flags", {"VERSIONED_EXPORT": False}, clear=True | ||
) | ||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") | ||
def test_export_dashboards_original(app_context, fs): | ||
""" | ||
|
@@ -73,6 +76,9 @@ def test_export_dashboards_original(app_context, fs): | |
json.loads(contents) | ||
|
||
|
||
@mock.patch.dict( | ||
"superset.cli.lib.feature_flags", {"VERSIONED_EXPORT": False}, clear=True | ||
) | ||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") | ||
def test_export_datasources_original(app_context, fs): | ||
""" | ||
|
@@ -91,6 +97,8 @@ def test_export_datasources_original(app_context, fs): | |
) | ||
|
||
assert response.exit_code == 0 | ||
# this api is deprecated, so it shows a response of 1 instead of 0 | ||
|
||
assert Path("datasources.yaml").exists() | ||
|
||
# check that file is valid JSON | ||
|
@@ -336,7 +344,7 @@ def test_import_datasets_versioned_export(import_datasets_command, app_context, | |
|
||
|
||
@mock.patch.dict( | ||
"superset.config.DEFAULT_FEATURE_FLAGS", {"VERSIONED_EXPORT": False}, clear=True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try |
||
"superset.cli.lib.feature_flags", {"VERSIONED_EXPORT": False}, clear=True | ||
) | ||
@mock.patch("superset.datasets.commands.importers.v0.ImportDatasetsCommand") | ||
def test_import_datasets_sync_argument_columns_metrics( | ||
|
@@ -371,7 +379,7 @@ def test_import_datasets_sync_argument_columns_metrics( | |
|
||
|
||
@mock.patch.dict( | ||
"superset.config.DEFAULT_FEATURE_FLAGS", {"VERSIONED_EXPORT": False}, clear=True | ||
"superset.cli.lib.feature_flags", {"VERSIONED_EXPORT": False}, clear=True | ||
) | ||
@mock.patch("superset.datasets.commands.importers.v0.ImportDatasetsCommand") | ||
def test_import_datasets_sync_argument_columns( | ||
|
@@ -406,7 +414,7 @@ def test_import_datasets_sync_argument_columns( | |
|
||
|
||
@mock.patch.dict( | ||
"superset.config.DEFAULT_FEATURE_FLAGS", {"VERSIONED_EXPORT": False}, clear=True | ||
"superset.cli.lib.feature_flags", {"VERSIONED_EXPORT": False}, clear=True | ||
) | ||
@mock.patch("superset.datasets.commands.importers.v0.ImportDatasetsCommand") | ||
def test_import_datasets_sync_argument_metrics( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1346,7 +1346,9 @@ def test_export(self): | |
# freeze time to ensure filename is deterministic | ||
with freeze_time("2020-01-01T00:00:00Z"): | ||
rv = self.get_assert_metric(uri, "export") | ||
headers = generate_download_headers("json")["Content-Disposition"] | ||
headers = generate_download_headers( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you leave this test unmodified and make it run with the feature flag off? @patch.dict(
"superset.extensions.feature_flag_manager._feature_flags",
{"VERSIONED_EXPORT": False},
clear=True,
) And maybe remove the feature flag patch from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Went through and removed this feature flag patch when set to true for a couple of tests. |
||
"zip", "dashboard_export_20200101T000000" | ||
)["Content-Disposition"] | ||
|
||
assert rv.status_code == 200 | ||
assert rv.headers["Content-Disposition"] == headers | ||
|
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.
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.
This is still unresolved. :)