Skip to content

Commit

Permalink
Fix dbt incremental_strategy behavior by fixing schema table existing…
Browse files Browse the repository at this point in the history
… check (#530)
  • Loading branch information
benc-db committed Jan 12, 2024
2 parents 212d046 + ac0cab6 commit 7421491
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

- Added python model specific connection handling to prevent using invalid sessions ([547](https://github.com/databricks/dbt-databricks/pull/547))
- 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 @@ -1238,15 +1238,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

0 comments on commit 7421491

Please sign in to comment.