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

Fix dbt incremental_strategy behavior by fixing schema table existing check #530

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

- Fix for issue where long-running python models led to invalid session errors ([544](https://github.com/databricks/dbt-databricks/pull/544))
- Allow schema to be specified in testing (thanks @case-k-git!) ([538](https://github.com/databricks/dbt-databricks/pull/538))
- Fix dbt incremental_strategy behavior by fixing schema table existing check (thanks @case-k-git!) ([530](https://github.com/databricks/dbt-databricks/pull/530))

## dbt-databricks 1.7.3 (Dec 12, 2023)

Expand Down
4 changes: 2 additions & 2 deletions dbt/adapters/databricks/connections.py
Expand Up @@ -1187,15 +1187,15 @@ def _execute_cursor(
def list_schemas(self, database: str, schema: Optional[str] = None) -> Table:
database = database.strip("`")
if schema:
schema = schema.strip("`")
schema = schema.strip("`").lower()
return self._execute_cursor(
f"GetSchemas(database={database}, schema={schema})",
lambda cursor: cursor.schemas(catalog_name=database, schema_name=schema),
)

def list_tables(self, database: str, schema: str, identifier: Optional[str] = None) -> Table:
database = database.strip("`")
schema = schema.strip("`")
schema = schema.strip("`").lower()
if identifier:
identifier = identifier.strip("`")
return self._execute_cursor(
Expand Down
Expand Up @@ -4,7 +4,7 @@
class TestIncrementalStrategies(DBTIntegrationTest):
@property
def schema(self):
return "incremental_strategies"
return "Incremental_strategies"

@property
def project_config(self):
Expand Down