Skip to content

Commit

Permalink
Move StatsItem, StatsDict, TableMetadata to dbt-common (#10238)
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke authored May 30, 2024
1 parent d8e38c1 commit 81386a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
1 change: 1 addition & 0 deletions core/dbt/artifacts/schemas/catalog/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# alias to latest
from dbt.artifacts.schemas.catalog.v1.catalog import * # noqa
from dbt_common.contracts.metadata import StatsDict, StatsItem, TableMetadata
23 changes: 1 addition & 22 deletions core/dbt/artifacts/schemas/catalog/v1/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
BaseArtifactMetadata,
schema_version,
)
from dbt_common.contracts.metadata import StatsDict, TableMetadata
from dbt_common.dataclass_schema import dbtClassMixin
from dbt_common.utils.formatting import lowercase

Expand All @@ -18,18 +19,6 @@
)


@dataclass
class StatsItem(dbtClassMixin):
id: str
label: str
value: Primitive
include: bool
description: Optional[str] = None


StatsDict = Dict[str, StatsItem]


@dataclass
class ColumnMetadata(dbtClassMixin):
type: str
Expand All @@ -41,16 +30,6 @@ class ColumnMetadata(dbtClassMixin):
ColumnMap = Dict[str, ColumnMetadata]


@dataclass
class TableMetadata(dbtClassMixin):
type: str
schema: str
name: str
database: Optional[str] = None
comment: Optional[str] = None
owner: Optional[str] = None


@dataclass
class CatalogTable(dbtClassMixin):
metadata: TableMetadata
Expand Down
2 changes: 1 addition & 1 deletion core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"minimal-snowplow-tracker>=0.0.2,<0.1",
"dbt-semantic-interfaces>=0.5.1,<0.6",
# Minor versions for these are expected to be backwards-compatible
"dbt-common>=1.1.0,<2.0",
"dbt-common>=1.2.0,<2.0",
"dbt-adapters>=1.1.1,<2.0",
# ----
# Expect compatibility with all new versions of these packages, so lower bounds only.
Expand Down

0 comments on commit 81386a7

Please sign in to comment.