Skip to content
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

SQLDecorator attempting to create a schema when it already exists #329

Closed
2 tasks
tatiana opened this issue May 3, 2022 · 0 comments · Fixed by #352
Closed
2 tasks

SQLDecorator attempting to create a schema when it already exists #329

tatiana opened this issue May 3, 2022 · 0 comments · Fixed by #352
Assignees
Labels
bug Something isn't working priority/critical Critical priority

Comments

@tatiana
Copy link
Collaborator

tatiana commented May 3, 2022

Describe the bug
When a schema already exists, we should not attempt to create it. This is particularly important for users who may not have permission to create schemas.

Reported by: @jlaneve

Version

  • Astro: 0.8.1

To Reproduce
When running queries against the snowflake_conn_4 connection, everything logs the error:

(snowflake.connector.errors.ProgrammingError) 003001 (42501): 01a3ebcc-0404-8f39-0000-68210845688e: SQL access control error:
Insufficient privileges to operate on database 'SANDBOX'
[SQL: CREATE SCHEMA IF NOT EXISTS tmp_astro]
(Background on this error at: http://sqlalche.me/e/13/f405)

Expected behavior
If a schema already exists, Astro should not attempt to create it.

Additional context
The SQLDecorator (in theory) should not need permission to create schemas. It originally did, and this commit fixed the issue. However, it was reverted in this commit 1 month ago. The specific line causing the issue is here.

Acceptance criteria

  • The SQLDecorator does not attempt to create schema when it does not exist
  • There is a test covering this use-case
@tatiana tatiana added bug Something isn't working priority/high High priority labels May 3, 2022
@tatiana tatiana mentioned this issue May 3, 2022
3 tasks
@tatiana tatiana added priority/critical Critical priority and removed priority/high High priority labels May 3, 2022
@tatiana tatiana self-assigned this May 3, 2022
tatiana added a commit that referenced this issue May 5, 2022
Fix #329 check if schema exists before creating it

Bonus: Fix the creation of temp table schema if it does not exist. A few BooleanCheck tests were failing due to this:
https://github.com/astro-projects/astro/runs/6288671851?check_suite_focus=true
tatiana added a commit that referenced this issue May 5, 2022
Bonus: Fix the creation of temp table schema if it does not exist. A few BooleanCheck tests were failing due to this:
https://github.com/astro-projects/astro/runs/6288671851?check_suite_focus=true
tatiana added a commit that referenced this issue May 5, 2022
Bonus: Fix the creation of temp table schema if it does not exist. A few BooleanCheck tests were failing due to this:
https://github.com/astro-projects/astro/runs/6288671851?check_suite_focus=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority/critical Critical priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant