Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move StatsItem, StatsDict, TableMetadata to dbt-common #10238

Merged
merged 14 commits into from
May 30, 2024
Merged
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
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
Loading