-
Notifications
You must be signed in to change notification settings - Fork 321
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
[Feature] add 'create_if_not_exists' for views #599
base: master
Are you sure you want to change the base?
Conversation
Add flag `create_if_not_exists` for `create_view` and `create_materialized_view`.
@kurtmckee Not sure if you are the right person. Can u help me have a look at this PR? |
@eterna2, I don't feel qualified yet to review feature requests; my focus has been ticket triage and bug fixes. The project policy is to have unit tests associated with pull requests, so you'll need to add unit tests that demonstrate that this feature is working. For example, it will be good to confirm that the function continues to raise an exception when the view already exists (the tests may already check this but you should confirm), and also test that the error is suppressed when @kvesteri, would you review this PR? I'm interested in your thoughts on the parameter name |
Hi, I had changed the kwargs to Also made several other changes:
I am actually using this for snowflake specifically. |
da72ba1
to
8e60563
Compare
8e60563
to
c62efa0
Compare
Sorry. Some unnecessarily format changes cuz i was using black to quickly do the autoformatting. |
Thanks @eterna2! I've kicked off the CI runs. Please also add unit tests that demonstrate the new functionality. |
Hi, I have added the unit tests for the new params. I just wrote the test for the generic use case and postgres. |
Seem like crypto package is raising a deprecation warning. Do u want me to add a marker to the requirement for py3.6? |
No, I can add that separately. |
Feature:
Add flag
create_if_not_exists
forcreate_view
andcreate_materialized_view
.Background:
Hi, I am using
create_view
andcreate_materialized_view
to generate views via cli. However, i will like the cli to not throw an error if the views already exists. This PR adds a kwargscreate_if_not_exists
forcreate_view
andcreate_materialized_view
, which will insertCREATE VIEW {} IF NOT EXISTS
if the flag is set.The default for the flag is
False
so that everything will be backward compatible.