dbt-labs / dbt-labs/dbt-external-tables
command running 'create schema if not exists' when schema exists
- Dominant language
- Jupyter Notebook
- Stars
- 384
- Forks
- 150
- Avg merge
- 1h 25m
- Merged PRs (30d)
- 1
Description
### Describe the bug
After version 0.8.3 run-operation stage_external_sources runs a ddl statement `create schema if not exists`. This is an issue for us because the user does not have permission to create datasets, and we don't want to allow this. The statement is run even if the schema already exists in the database.
Checking if the schema exists, and only running the statement if the schema is missing would fix the problem.
### Steps to reproduce
run `run-operation stage_external_sources` with user/serviceaccount without bigquery.datasets.create permission
### Expected results
External source is created. This is the result up to version 0.8.2
### Actual results
Error message:
```
Encountered an error while running operation: Database Error
Access Denied: Project my-bq-project: User does not have bigquery.datasets.create permission in project my-bq-project.
```
### System information
**The contents of your `packages.yml` file:**
packages:
- package: dbt-labs/dbt_external_tables
version: 0.8.3
**Which database are you using dbt with?**
- [ ] redshift
- [ ] snowflake
- [X] other (specify: bigquery)
**The output of `dbt --version`:**
```
latest
```
**The operating system you're using:**
**The output of `python --version`:**
### Additional context
Running on dbt cloud
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.