-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.py
62 lines (41 loc) · 1.68 KB
/
config.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
from dataclasses import field as dataclass_field
from typing import List, Literal, Optional
from pydantic.dataclasses import dataclass
from metaphor.common.base_config import BaseConfig
from metaphor.common.dataclass import ConnectorConfig
MetaOwnershipAssignmentTarget = Literal["dbt_model", "materialized_table", "both"]
@dataclass(config=ConnectorConfig)
class MetaOwnership:
# Key to match in the "meta" field
meta_key: str
# Type of ownership to assign
ownership_type: str
# Domain for user names
email_domain: Optional[str] = None
# The target to assign this ownership to. Can be either the dbt model, the materialized table, or both.
# Defaults to both.
assignment_target: MetaOwnershipAssignmentTarget = "both"
@dataclass(config=ConnectorConfig)
class MetaTag:
# Key to match in the "meta" field
meta_key: str
# Type of the tag to assign
tag_type: str
# Regex to match the value
meta_value_matcher: str = "True"
@dataclass(config=ConnectorConfig)
class DbtRunConfig(BaseConfig):
manifest: str
run_results: Optional[str] = None
# the database service account this DBT project is connected to
account: Optional[str] = None
# the dbt docs base URL
docs_base_url: Optional[str] = None
# the source code URL for the project directory
project_source_url: Optional[str] = None
# map meta field to ownerships
meta_ownerships: List[MetaOwnership] = dataclass_field(default_factory=lambda: [])
# Deprecated. Use meta_key_tags instead
meta_tags: List[MetaTag] = dataclass_field(default_factory=lambda: [])
# Maps meta field to additional dbt tags
meta_key_tags: Optional[str] = None