cccs-Dustin opened a new pull request #18046:
URL: https://github.com/apache/superset/pull/18046


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   1) Modified line 573 in `/superset/superset/cli.py`, as the previous code 
was not properly assigning a boolean value to sync_columns and sync_metrics.
   2) Added lines 324-413 in `superset/tests/integration_tests/cli_tests.py` 
for 3 new unit tests to make sure the --sync flag is working correctly.
   
   By modifying the code in `/superset/superset/cli.py`, the Superset 
import_datasources cli now correctly functions with the --sync flag.
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   1) Add an existing yaml file to superset by using the Superset cli:
   `superset import-datasources -p ~/datasets/data.yaml`
   2) Once the yaml file has been added, try using the command again but with 
the "-s"/"--sync" flag (imitating what it would be like if you modified a 
column name or metric in the YAML file and wanted it to be mirrored in the 
Superset Dataset):
   `superset import-datasources -s "metrics,columns" -p ~/datasets/data.yaml`
   3) Now that the "-s"/"--sync" flag works as intended, it deletes metrics 
and/or columns in the DB that are not specified in the YAML file (when using 
the "-s"/"--sync" flag).
   
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: Fixes #18029
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to