* 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
* Update db setup fixture scope
* Load data into db only once
* Update fixture scopes for data loading
* cleanup imports
* try import
* Update scope
* fix cleanup
* Import all fixtures
* Separate data log and metadata creation
* Retain table description
* fix dtype
Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
* Test that failing export or import is done properly
For each CLI entry-point we will modify, we make sure that:
- a failing process exits with a non-0 exit code,
- an error is logged.
Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>
* Exit process with error if export/import failed
Bubble exception up when failing import or export
During a CLI import or export of dashboards, if the process fails, the
exception it caught and a simple message is sent to the logger.
This makes that from a shell point of view, the script was successfull —
cf. #16956.
To prevent this, we want to ensure that the process exits with an error
(i.e., a non-0 exit-code) should the export or import fail mid-flight.
Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>