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

Fixed manifest v11 resource types #68

Merged
merged 1 commit into from
Jan 4, 2024
Merged
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
89 changes: 41 additions & 48 deletions dbt_artifacts_parser/parsers/manifest/manifest_v11.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

from dbt_artifacts_parser.parsers.base import BaseParserModel


class ResourceType11(Enum):
doc = 'doc'
class Documentation(BaseParserModel):
class Config:
extra = Extra.forbid

name: str
resource_type: Any
resource_type: ResourceType11
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -85,41 +86,11 @@ class Access(Enum):


class ResourceType(Enum):
model = 'model'
analysis = 'analysis'
test = 'test'
snapshot = 'snapshot'
operation = 'operation'
seed = 'seed'
rpc = 'rpc'
sql_operation = 'sql_operation'
doc = 'doc'
source = 'source'
macro = 'macro'
exposure = 'exposure'
metric = 'metric'
group = 'group'
saved_query = 'saved_query'
semantic_model = 'semantic_model'


class ResourceType1(Enum):
model = 'model'
analysis = 'analysis'
test = 'test'
snapshot = 'snapshot'
operation = 'operation'
seed = 'seed'
rpc = 'rpc'
sql_operation = 'sql_operation'
doc = 'doc'
source = 'source'
macro = 'macro'
exposure = 'exposure'
metric = 'metric'
group = 'group'
saved_query = 'saved_query'
semantic_model = 'semantic_model'


class Contract(BaseParserModel):
Expand Down Expand Up @@ -570,13 +541,15 @@ class Config:
is_start: Optional[bool] = False
is_end: Optional[bool] = False

class ResourceType12(Enum):
exposure = 'exposure'

class Exposure(BaseParserModel):
class Config:
extra = Extra.forbid

name: str
resource_type: Any
resource_type: ResourceType12
package_name: str
path: str
original_file_path: str
Expand All @@ -598,26 +571,30 @@ class Config:
metrics: Optional[List[List[str]]] = None
created_at: Optional[float] = None

class ResourceType14(Enum):
group = 'group'

class Group(BaseParserModel):
class Config:
extra = Extra.forbid

name: str
resource_type: Any
resource_type: ResourceType14
package_name: str
path: str
original_file_path: str
unique_id: str
owner: Owner

class ResourceType10(Enum):
macro = 'macro'

class Macro(BaseParserModel):
class Config:
extra = Extra.forbid

name: str
resource_type: Any
resource_type: ResourceType10
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -867,7 +844,7 @@ class Config:
database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -904,6 +881,8 @@ class Config:
_pre_injected_sql: Optional[Optional[str]] = None
contract: Optional[Contract] = None

class ResourceType6(Enum):
test = 'test'

class GenericTestNode(BaseParserModel):
class Config:
Expand All @@ -913,7 +892,7 @@ class Config:
database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType6
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -953,6 +932,8 @@ class Config:
file_key_name: Optional[Optional[str]] = None
attached_node: Optional[Optional[str]] = None

class ResourceType2(Enum):
operation = 'operation'

class HookNode(BaseParserModel):
class Config:
Expand All @@ -961,7 +942,7 @@ class Config:
database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType2
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -999,6 +980,8 @@ class Config:
contract: Optional[Contract] = None
index: Optional[Optional[int]] = None

class ResourceType3(Enum):
model = 'model'

class ModelNode(BaseParserModel):
class Config:
Expand All @@ -1007,7 +990,7 @@ class Config:
database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType3
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -1050,6 +1033,8 @@ class Config:
deprecation_date: Optional[Optional[str]] = None
defer_relation: Optional[Optional[DeferRelation]] = None

class ResourceType4(Enum):
rpc = 'rpc'

class RPCNode(BaseParserModel):
class Config:
Expand All @@ -1058,7 +1043,7 @@ class Config:
database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType4
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -1095,6 +1080,8 @@ class Config:
_pre_injected_sql: Optional[Optional[str]] = None
contract: Optional[Contract] = None

class ResourceType8(Enum):
seed = 'seed'

class SeedNode(BaseParserModel):
class Config:
Expand All @@ -1103,7 +1090,7 @@ class Config:
database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType8
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -1139,7 +1126,7 @@ class Config:
database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType1
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -1176,15 +1163,16 @@ class Config:
_pre_injected_sql: Optional[Optional[str]] = None
contract: Optional[Contract] = None


class ResourceType7(Enum):
snapshot = 'snapshot'
class SnapshotNode(BaseParserModel):
class Config:
extra = Extra.forbid

database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType7
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -1222,6 +1210,8 @@ class Config:
contract: Optional[Contract] = None
defer_relation: Optional[Optional[DeferRelation]] = None

class ResourceType9(Enum):
source = 'source'

class SourceDefinition(BaseParserModel):
class Config:
Expand All @@ -1230,7 +1220,7 @@ class Config:
database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType9
package_name: str
path: str
original_file_path: str
Expand All @@ -1256,15 +1246,16 @@ class Config:
relation_name: Optional[Optional[str]] = None
created_at: Optional[float] = None


class ResourceType5(Enum):
sql_operation = 'sql_operation'
class SqlNode(BaseParserModel):
class Config:
extra = Extra.forbid

database: Optional[str]
schema_: str = Field(..., alias='schema')
name: str
resource_type: Any
resource_type: ResourceType5
package_name: str
path: str
original_file_path: str
Expand Down Expand Up @@ -1338,13 +1329,15 @@ class Config:
group_by: List[str]
where: Optional[WhereFilterIntersection]

class ResourceType13(Enum):
metric = 'metric'

class Metric(BaseParserModel):
class Config:
extra = Extra.forbid

name: str
resource_type: Any
resource_type: ResourceType13
package_name: str
path: str
original_file_path: str
Expand Down