This repository was archived by the owner on May 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +16
-16
lines changed Expand file tree Collapse file tree 10 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ def dialect(self) -> "BaseDialect":
131
131
def compile (self , elem , params = None ) -> str :
132
132
return self .dialect .compile (self , elem , params )
133
133
134
- def new_unique_name (self , prefix = "tmp" ):
134
+ def new_unique_name (self , prefix = "tmp" ) -> str :
135
135
self ._counter [0 ] += 1
136
136
return f"{ prefix } { self ._counter [0 ]} "
137
137
Original file line number Diff line number Diff line change @@ -85,10 +85,10 @@ class Dialect(BaseDialect):
85
85
def random (self ) -> str :
86
86
return "RAND()"
87
87
88
- def quote (self , s : str ):
88
+ def quote (self , s : str ) -> str :
89
89
return f"`{ s } `"
90
90
91
- def to_string (self , s : str ):
91
+ def to_string (self , s : str ) -> str :
92
92
return f"cast({ s } as string)"
93
93
94
94
def type_repr (self , t ) -> str :
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def type_repr(self, t) -> str:
65
65
except KeyError :
66
66
return super ().type_repr (t )
67
67
68
- def quote (self , s : str ):
68
+ def quote (self , s : str ) -> str :
69
69
return f"`{ s } `"
70
70
71
71
def to_string (self , s : str ) -> str :
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class Dialect(BaseDialect):
76
76
"json" : JSON ,
77
77
}
78
78
79
- def quote (self , s : str ):
79
+ def quote (self , s : str ) -> str :
80
80
return f"[{ s } ]"
81
81
82
82
def set_timezone_to_utc (self ) -> str :
@@ -93,7 +93,7 @@ def current_schema(self) -> str:
93
93
FROM sys.database_principals
94
94
WHERE name = CURRENT_USER"""
95
95
96
- def to_string (self , s : str ):
96
+ def to_string (self , s : str ) -> str :
97
97
# Both convert(varchar(max), …) and convert(text, …) do work.
98
98
return f"CONVERT(VARCHAR(MAX), { s } )"
99
99
Original file line number Diff line number Diff line change @@ -70,10 +70,10 @@ class Dialect(BaseDialect):
70
70
"boolean" : Boolean ,
71
71
}
72
72
73
- def quote (self , s : str ):
73
+ def quote (self , s : str ) -> str :
74
74
return f"`{ s } `"
75
75
76
- def to_string (self , s : str ):
76
+ def to_string (self , s : str ) -> str :
77
77
return f"cast({ s } as char)"
78
78
79
79
def is_distinct_from (self , a : str , b : str ) -> str :
Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ class Dialect(
59
59
ROUNDS_ON_PREC_LOSS = True
60
60
PLACEHOLDER_TABLE = "DUAL"
61
61
62
- def quote (self , s : str ):
62
+ def quote (self , s : str ) -> str :
63
63
return f'"{ s } "'
64
64
65
- def to_string (self , s : str ):
65
+ def to_string (self , s : str ) -> str :
66
66
return f"cast({ s } as varchar(1024))"
67
67
68
68
def limit_select (
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class Dialect(BaseDialect):
60
60
# https://www.vertica.com/docs/9.3.x/HTML/Content/Authoring/SQLReferenceManual/DataTypes/Numeric/NUMERIC.htm#Default
61
61
DEFAULT_NUMERIC_PRECISION = 15
62
62
63
- def quote (self , s : str ):
63
+ def quote (self , s : str ) -> str :
64
64
return f'"{ s } "'
65
65
66
66
def concat (self , items : List [str ]) -> str :
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def parse_time_atom(count, unit):
53
53
return count , unit
54
54
55
55
56
- def parse_time_delta (t : str ):
56
+ def parse_time_delta (t : str ) -> timedelta :
57
57
time_dict = {}
58
58
while t :
59
59
m = TIME_RE .match (t )
@@ -70,5 +70,5 @@ def parse_time_delta(t: str):
70
70
return timedelta (** time_dict )
71
71
72
72
73
- def parse_time_before (time : datetime , delta : str ):
73
+ def parse_time_before (time : datetime , delta : str ) -> datetime :
74
74
return time - parse_time_delta (delta )
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ def __attrs_post_init__(self) -> None:
138
138
f"Error: min_update expected to be smaller than max_update! ({ self .min_update } >= { self .max_update } )"
139
139
)
140
140
141
- def _where (self ):
141
+ def _where (self ) -> Optional [ str ] :
142
142
return f"({ self .where } )" if self .where else None
143
143
144
144
def _with_raw_schema (self , raw_schema : Dict [str , RawColumnInfo ]) -> Self :
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ def disable_tracking() -> None:
85
85
g_tracking_enabled = False
86
86
87
87
88
- def is_tracking_enabled ():
88
+ def is_tracking_enabled () -> bool :
89
89
return g_tracking_enabled
90
90
91
91
@@ -114,7 +114,7 @@ def set_dbt_project_id(s) -> None:
114
114
dbt_project_id = s
115
115
116
116
117
- def get_anonymous_id ():
117
+ def get_anonymous_id () -> str :
118
118
global g_anonymous_id
119
119
if g_anonymous_id is None :
120
120
profile = _load_profile ()
You can’t perform that action at this time.
0 commit comments