forked from yu-iskw/dbt-artifacts-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_results_v2.py
76 lines (58 loc) · 1.68 KB
/
run_results_v2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# generated by datamodel-codegen:
# filename: run-results_v2.json
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional, Union
from pydantic import ConfigDict
from collate_dbt_artifacts_parser.parsers.base import BaseParserModel
class BaseArtifactMetadata(BaseParserModel):
model_config = ConfigDict(
extra="forbid",
)
dbt_schema_version: str
dbt_version: Optional[str] = "0.20.0rc1"
generated_at: Optional[datetime] = "2021-06-07T14:49:01.097134Z"
invocation_id: Optional[str] = None
env: Optional[Dict[str, str]] = {}
class Status(Enum):
success = "success"
error = "error"
skipped = "skipped"
class Status1(Enum):
pass_ = "pass"
error = "error"
fail = "fail"
warn = "warn"
class Status2(Enum):
pass_ = "pass"
warn = "warn"
error = "error"
runtime_error = "runtime error"
class TimingInfo(BaseParserModel):
model_config = ConfigDict(
extra="forbid",
)
name: str
started_at: Optional[datetime] = None
completed_at: Optional[datetime] = None
class RunResultOutput(BaseParserModel):
model_config = ConfigDict(
extra="forbid",
)
status: Union[Status, Status1, Status2]
timing: List[TimingInfo]
thread_id: str
execution_time: float
adapter_response: Dict[str, Any]
message: Optional[str] = None
failures: Optional[int] = None
unique_id: str
class RunResultsV2(BaseParserModel):
model_config = ConfigDict(
extra="forbid",
)
metadata: BaseArtifactMetadata
results: List[RunResultOutput]
elapsed_time: float
args: Optional[Dict[str, Any]] = {}