Skip to content

Commit

Permalink
Update the parsers using dbt artifacts of dbt-core 1.9.0-rc1 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-iskw authored Nov 29, 2024
1 parent ce07b92 commit f970737
Show file tree
Hide file tree
Showing 11 changed files with 10,751 additions and 9,712 deletions.
51 changes: 31 additions & 20 deletions dbt_artifacts_parser/parsers/catalog/catalog_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,83 @@

from __future__ import annotations

from typing import Dict, List, Optional, Union
from typing import Any, Dict, List, Optional, Union

from pydantic import AwareDatetime, ConfigDict, Field
from pydantic import ConfigDict, Field

from dbt_artifacts_parser.parsers.base import BaseParserModel


class CatalogMetadata(BaseParserModel):
class Metadata(BaseParserModel):
model_config = ConfigDict(
extra='forbid',
)
dbt_schema_version: Optional[str] = 'https://schemas.getdbt.com/dbt/catalog/v1.json'
dbt_version: Optional[str] = '0.19.0'
generated_at: Optional[AwareDatetime] = '2021-02-10T04:42:33.680487Z'
dbt_schema_version: Optional[str] = None
dbt_version: Optional[str] = '1.9.0b2'
generated_at: Optional[str] = None
invocation_id: Optional[str] = None
env: Optional[Dict[str, str]] = {}
env: Optional[Dict[str, str]] = None


class TableMetadata(BaseParserModel):
class Metadata1(BaseParserModel):
model_config = ConfigDict(
extra='forbid',
)
type: str
database: Optional[str] = None
schema_: str = Field(..., alias='schema')
name: str
database: Optional[str] = None
comment: Optional[str] = None
owner: Optional[str] = None


class ColumnMetadata(BaseParserModel):
class Columns(BaseParserModel):
model_config = ConfigDict(
extra='forbid',
)
type: str
comment: Optional[str] = None
index: int
name: str
comment: Optional[str] = None


class StatsItem(BaseParserModel):
class Stats(BaseParserModel):
model_config = ConfigDict(
extra='forbid',
)
id: str
label: str
value: Optional[Union[bool, str, float]] = None
description: Optional[str] = None
include: bool
description: Optional[str] = None


class Nodes(BaseParserModel):
model_config = ConfigDict(
extra='forbid',
)
metadata: Metadata1 = Field(..., title='TableMetadata')
columns: Dict[str, Columns]
stats: Dict[str, Stats]
unique_id: Optional[str] = None


class CatalogTable(BaseParserModel):
class Sources(BaseParserModel):
model_config = ConfigDict(
extra='forbid',
)
metadata: TableMetadata
columns: Dict[str, ColumnMetadata]
stats: Dict[str, StatsItem]
metadata: Metadata1 = Field(..., title='TableMetadata')
columns: Dict[str, Columns]
stats: Dict[str, Stats]
unique_id: Optional[str] = None


class CatalogV1(BaseParserModel):
model_config = ConfigDict(
extra='forbid',
)
metadata: CatalogMetadata
nodes: Dict[str, CatalogTable]
sources: Dict[str, CatalogTable]
metadata: Metadata = Field(..., title='CatalogMetadata')
nodes: Dict[str, Nodes]
sources: Dict[str, Sources]
errors: Optional[List[str]] = None
field_compile_results: Any = Field(None, alias='_compile_results')
Loading

0 comments on commit f970737

Please sign in to comment.