mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix(import_datasources): --sync flag works correctly (#18046)
* Added code that properly accepts the -s flag on the import-datasources cli command. Also added unit tests for all of the edge cases (with both metrics & columns, with just columns, and with just metrics) * Files were reformated using the 'pre-commit run --all-files' command * added '*args: Any' back into v0.py as it did not need to be removed. Removing it might cause headaches for someone trying to work on this particular piece of code in the future * Fixed the merge conflict as the cli.py was moved to another directory * Modified my created unit tests to work with the new format of uni tests since the merge * Modified my created unit tests to work with the new format of uni tests since the merge * Fixed errors which were encountered while using the unit tests
This commit is contained in:
@@ -358,7 +358,9 @@ else:
|
||||
with open(path_) as file:
|
||||
contents[path_.name] = file.read()
|
||||
try:
|
||||
ImportDatasetsCommand(contents, sync_columns, sync_metrics).run()
|
||||
ImportDatasetsCommand(
|
||||
contents, sync_columns=sync_columns, sync_metrics=sync_metrics
|
||||
).run()
|
||||
except Exception: # pylint: disable=broad-except
|
||||
logger.exception("Error when importing dataset")
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user