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:
cccs-Dustin
2022-01-25 09:53:44 -05:00
committed by GitHub
parent f018c826b8
commit 2dd64f9a93
2 changed files with 108 additions and 1 deletions

View File

@@ -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)