Skip to content

Commit

Permalink
CatalogIntegration contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Dec 6, 2024
1 parent c7b12ae commit 916f755
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions dbt/adapters/base/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def __init__(self, profile: AdapterRequiredConfig, mp_context: SpawnContext) ->
self.thread_connections: Dict[Hashable, Connection] = {}
self.lock: RLock = mp_context.RLock()
self.query_header: Optional[MacroQueryStringSetter] = None
self.catalog_integrations = catalog_integrations or []

def set_query_header(self, query_header_context: Dict[str, Any]) -> None:
self.query_header = MacroQueryStringSetter(self.profile, query_header_context)
Expand Down
19 changes: 19 additions & 0 deletions dbt/adapters/contracts/catalog_integration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from dataclasses import dataclass

from dbt_common.dataclass_schema import StrEnum


class TableFormat(StrEnum):
iceberg = "iceberg"


class CatalogIntegrationType(StrEnum):
glue = "glue"


@dataclass
class CatalogIntegration:
name: str
external_volume: str
table_format: TableFormat
type: CatalogIntegrationType
2 changes: 2 additions & 0 deletions dbt/adapters/contracts/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from mashumaro.jsonschema.annotations import Pattern
from typing_extensions import Protocol, Annotated

from dbt.adapters.contracts.catalog_integration import CatalogIntegration
from dbt.adapters.events.types import NewConnectionOpening
from dbt.adapters.utils import translate_aliases

Expand Down Expand Up @@ -227,3 +228,4 @@ class AdapterRequiredConfig(HasCredentials, Protocol):
cli_vars: Dict[str, Any]
target_path: str
log_cache_events: bool
catalog_integrations: Optional[List[CatalogIntegration]]

0 comments on commit 916f755

Please sign in to comment.