Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dbt/adapters/databricks/events/credential_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def __init__(self, exception: Exception):


class CredentialShardEvent:
def __init__(self, password_len: int):
self.password_len = password_len
def __init__(self):
pass

def __str__(self) -> str:
return f"Password is {self.password_len} characters, sharding it"
return "Sharding credentials"
4 changes: 3 additions & 1 deletion dbt/adapters/databricks/relation_configs/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class QueryProcessor(DatabricksComponentProcessor[QueryConfig]):
@classmethod
def from_relation_results(cls, result: RelationResults) -> QueryConfig:
view_definition = result["information_schema.views"]["view_definition"].strip()
if view_definition[0] == "(" and view_definition[-1] == ")":
if view_definition.startswith("(") and view_definition.endswith(")"):
view_definition = view_definition[1:-1]
return QueryConfig(query=SqlUtils.clean_sql(view_definition))

Expand All @@ -49,4 +49,6 @@ class DescribeQueryProcessor(QueryProcessor):
def from_relation_results(cls, result: RelationResults) -> QueryConfig:
table = result["describe_extended"]
row = next(x for x in table if x[0] == "View Text")
if len(row) < 2:
raise DbtRuntimeError("Unexpected result from DESCRIBE EXTENDED: missing View Text value")
return QueryConfig(query=SqlUtils.clean_sql(row[1]))