-
Notifications
You must be signed in to change notification settings - Fork 26
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
chore: avoid virtual datasets whenever possible #295
Conversation
e7b70c5
to
6d8d25b
Compare
6d8d25b
to
c75ab5e
Compare
except SupersetError as ex: | ||
if not no_catalog_support(ex): | ||
raise ex | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just delete the catalog
key here (del kwargs["catalog"]
)
except SupersetError as ex: | ||
if not no_catalog_support(ex): | ||
raise ex | ||
|
||
url = make_url(database["sqlalchemy_uri"]) | ||
if model_in_database(model, url): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then avoid this if/else
and have a single if not model_in_database(model, url)
with kwargs["sql"] = f"SELECT * FROM {source}"
(and the remaining logic that's specific for virtual datasets)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a non-blocking suggestion
With SIP-95 implemented we don't need virtual datasets anymore, yay!
Note: ideally this still requires testing with a real project, and also for the SIP-95 branch to be deployed at Preset.