This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconstants.py
110 lines (80 loc) · 2.32 KB
/
constants.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
from __future__ import annotations
import sys
from enum import Enum
# typing.Literal was only introduced in Python 3.8, and we support Python 3.7
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
class Location(Enum):
LOCAL = "local"
GS = "gs" # Google Cloud Storage
S3 = "s3" # Amazon S3
SFTP = "sftp"
SQLITE = "sqlite"
BIGQUERY = "bigquery"
SNOWFLAKE = "snowflake"
def __repr__(self):
return f"{self}"
class FileLocation(Enum):
# [START filelocation]
LOCAL = "local"
GS = "gs" # Google Cloud Storage
S3 = "s3" # Amazon S3
SFTP = "sftp"
# [END filelocation]
def __repr__(self):
return f"{self}"
class IngestorSupported(Enum):
# [START transferingestor]
Fivetran = "fivetran"
# [END transferingestor]
def __repr__(self):
return f"{self}"
class TransferMode(Enum):
# [START TransferMode]
NATIVE = "native"
NONNATIVE = "nonnative"
THIRDPARTY = "thirdparty"
# [END TransferMode]
def __str__(self) -> str:
return self.value
class FileType(Enum):
# [START filetypes]
CSV = "csv"
JSON = "json"
NDJSON = "ndjson"
PARQUET = "parquet"
# [END filetypes]
def __repr__(self):
return f"{self}"
class Database(Enum):
# [START database]
SQLITE = "sqlite"
BIGQUERY = "bigquery"
SNOWFLAKE = "snowflake"
# [END database]
def __repr__(self):
return f"{self}"
class FivetranConnectorSupported(Enum):
# [START FivetranConnectorSupported]
S3 = "S3"
# [END FivetranConnectorSupported]
def __str__(self) -> str:
return self.value
class FivetranDestinationSupported(Enum):
# [START FivetranDestinationSupported]
SNOWFLAKE = "snowflake"
# [END FivetranDestinationSupported]
def __str__(self) -> str:
return self.value
SUPPORTED_FILE_LOCATIONS = [const.value for const in FileLocation]
SUPPORTED_FILE_TYPES = [const.value for const in FileType]
SUPPORTED_DATABASES = [const.value for const in Database]
# [START LoadExistStrategy]
LoadExistStrategy = Literal["replace", "append"]
# [END LoadExistStrategy]
DEFAULT_CHUNK_SIZE = 1000000
ColumnCapitalization = Literal["upper", "lower", "original"]
DEFAULT_SCHEMA = "tmp_transfers"
IAM_ROLE_ACTIVATION_WAIT_TIME = 60