-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Adding YAML Import-Export for Datasources to CLI #3978
Conversation
Looks like travis isn't kicking in, any idea why? I noticed that before only on your PRs, bad luck or something related to your workflow? |
40d28bf
to
dd3c564
Compare
Apparently travis says 'abuse detected'. I'm contacting travis support and CC you. |
In the meantime you can probably branch off your branch, amend the commit with a different commit message to get a different SHA, and open a new PR off of it referencing this one. Might work... |
dd3c564
to
3a85c1e
Compare
3a85c1e
to
20a1fd0
Compare
f8099c0
to
bc4f9ac
Compare
Finally got picked up by Travis. |
Hi @mistercrunch , I am very interested in this feature
is there any plans for that? |
@yamyamyuo note that it's possible to do most of this using the ORM directly. Could be good to have a code generation feature as an export. Exporting would generate code that uses the ORM to create the slice and/or dashboard. Check out this file for an example of how we generate the examples: Note that of course this isn't a public API, and we won't provide guarantees around forward compatibility, though it shouldn't change much. |
@mistercrunch I have a deeper look at superset. I found the security part is very detailed but also complex.
There are so many questions🙈I am really appreciated if you can share your experience or advice! |
* Adding import and export for databases * Linting
* Adding import and export for databases * Linting
Summary
Adding YAML import and export for datasources, which includes (SqlAlchemy) Databases and Druid Clusters to the Superset CLI.
Description
I added the core of the Import/Export logic to the
ImportMixin
mix-in class. It heavily relies on SqlAlchemy to determine the schema of the YAML and the relationship of objects. Specifically it uses unique constraints to identify and update existing elements. This required me to add unique constraints to existing tables, but I'm pretty confident that this should not cause major issues with existing installations since I added them in the "spirit" of the current design.In addition to the SqlAlchemy relationships the main object hierarchy needs to be defined by configuring the
export_parent
andexport_children
attributes appropriately (documented in code).The unit test covers only basic importing exporting (it was liftet from the existing pickle import/export) and should probably be extended to cover more edge cases.
You can export databases, druid clusters, tables, datasources from the UI:
Possible Future Projects/Improvements
Re-created #2993 This PR was getting too old for travis.
Context: https://groups.google.com/forum/#!topic/airbnb_superset/GeWZs42_NyA