Skip to content

Commit

Permalink
Simplifications per review
Browse files Browse the repository at this point in the history
  • Loading branch information
peterallenwebb committed Oct 11, 2023
1 parent 0a01187 commit 8e3fd10
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions dbt/adapters/snowflake/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
CapabilitySupport,
ConstraintSupport,
Support,
CapabilityDict,
) # type: ignore
from dbt.adapters.base.meta import available
from dbt.adapters.sql import SQLAdapter # type: ignore
Expand Down Expand Up @@ -55,16 +56,18 @@ class SnowflakeAdapter(SQLAdapter):
ConstraintType.foreign_key: ConstraintSupport.NOT_ENFORCED,
}

_capabilities: Dict[Capability, CapabilitySupport] = {
Capability.TableLastModifiedMetadata: CapabilitySupport(
capability=Capability.TableLastModifiedMetadata,
support=Support.Full,
),
Capability.SchemaMetadataByRelations: CapabilitySupport(
capability=Capability.SchemaMetadataByRelations,
support=Support.NotImplemented,
),
}
_capabilities: CapabilityDict = CapabilityDict(
{
Capability.TableLastModifiedMetadata: CapabilitySupport(
capability=Capability.TableLastModifiedMetadata,
support=Support.Full,
),
Capability.SchemaMetadataByRelations: CapabilitySupport(
capability=Capability.SchemaMetadataByRelations,
support=Support.NotImplemented,
),
}
)

@classmethod
def date_function(cls):
Expand Down Expand Up @@ -277,14 +280,5 @@ def debug_query(self):
"""Override for DebugTask method"""
self.execute("select 1 as id")

def capabilities(self) -> List[CapabilitySupport]:
return [c for c in self._capabilities.values()]

def capability_support(self, capability: Capability) -> CapabilitySupport:
if capability in self._capabilities:
return self._capabilities[capability]
else:
return CapabilitySupport(
capability=capability,
support=Support.Unknown,
)
def capabilities(self) -> CapabilityDict:
return self._capabilities

0 comments on commit 8e3fd10

Please sign in to comment.