Skip to content

Commit

Permalink
addressing comment, passing lint
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db committed Oct 23, 2023
1 parent 823397f commit 8204482
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## dbt-databricks 1.7.x (TBD)

### Features

- Added support for getting freshness from metadata ([481](https://github.com/databricks/dbt-databricks/pull/481))

## dbt-databricks 1.7.0rc1 (October 13, 2023)

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/databricks/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from agate import Row, Table, Text

from dbt.adapters.base import AdapterConfig, PythonJobHelper
from dbt.adapters.base.impl import catch_as_completed, FreshnessResponse
from dbt.adapters.base.impl import catch_as_completed
from dbt.adapters.base.meta import available
from dbt.adapters.base.relation import BaseRelation, InformationSchema
from dbt.adapters.capability import CapabilityDict, CapabilitySupport, Support, Capability
Expand Down
4 changes: 2 additions & 2 deletions dbt/adapters/databricks/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DatabricksInformationSchema(InformationSchema):
include_policy: Policy = field(default_factory=lambda: DatabricksIncludePolicy())
quote_character: str = "`"

def is_hive_metastore(self):
def is_hive_metastore(self) -> bool:
return self.database is None or self.database == "hive_metastore"


Expand Down Expand Up @@ -126,7 +126,7 @@ def matches(
def get_relation_type(cls) -> Type[DatabricksRelationType]:
return DatabricksRelationType

def information_schema(self, view_name=None) -> InformationSchema:
def information_schema(self, view_name: Optional[str] = None) -> InformationSchema:
# some of our data comes from jinja, where things can be `Undefined`.
if not isinstance(view_name, str):
view_name = None
Expand Down
4 changes: 2 additions & 2 deletions dbt/include/databricks/macros/metadata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from {{ information_schema }}.tables
where (
{%- for relation in relations -%}
(upper(table_schema) = upper('{{ relation.schema }}') and
upper(table_name) = upper('{{ relation.identifier }}')){%- if not loop.last %} or {% endif -%}
(table_schema = '{{ relation.schema }}' and
table_name = '{{ relation.identifier }}'){%- if not loop.last %} or {% endif -%}
{%- endfor -%}
)
{% endif %}
Expand Down

0 comments on commit 8204482

Please sign in to comment.