sqlframe 3.10.1__py3-none-any.whl → 3.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,138 +1,21 @@
1
- import typing as t
2
-
3
- from sqlframe.base.column import Column as Column
4
- from sqlframe.base.function_alternatives import ( # noqa
5
- any_value_ignore_nulls_not_supported as any_value,
6
- )
7
- from sqlframe.base.function_alternatives import (
8
- array_union_using_array_concat as array_union,
9
- )
10
- from sqlframe.base.function_alternatives import (
11
- base64_from_blob as base64,
12
- )
13
- from sqlframe.base.function_alternatives import (
14
- bit_length_from_length as bit_length,
15
- )
16
- from sqlframe.base.function_alternatives import (
17
- collect_set_from_list_distinct as collect_set,
18
- )
19
- from sqlframe.base.function_alternatives import (
20
- concat_ws_from_array_to_string as concat_ws,
21
- )
22
- from sqlframe.base.function_alternatives import (
23
- current_user_from_session_user as current_user,
24
- )
25
- from sqlframe.base.function_alternatives import (
26
- dayofmonth_from_extract_with_day as dayofmonth,
27
- )
28
- from sqlframe.base.function_alternatives import (
29
- dayofweek_from_extract as dayofweek,
30
- )
31
- from sqlframe.base.function_alternatives import (
32
- dayofyear_from_extract as dayofyear,
33
- )
34
- from sqlframe.base.function_alternatives import (
35
- e_literal as e,
36
- )
37
- from sqlframe.base.function_alternatives import (
38
- element_at_using_brackets as element_at,
39
- )
40
- from sqlframe.base.function_alternatives import (
41
- expm1_from_exp as expm1,
42
- )
43
- from sqlframe.base.function_alternatives import (
44
- extract_convert_to_var as extract,
45
- )
46
- from sqlframe.base.function_alternatives import (
47
- factorial_from_case_statement as factorial,
48
- )
49
- from sqlframe.base.function_alternatives import (
50
- format_string_with_format as format_string,
51
- )
52
- from sqlframe.base.function_alternatives import (
53
- hash_from_farm_fingerprint as hash,
54
- )
55
- from sqlframe.base.function_alternatives import (
56
- hex_casted_as_bytes as hex,
57
- )
58
- from sqlframe.base.function_alternatives import (
59
- hour_from_extract as hour,
60
- )
61
- from sqlframe.base.function_alternatives import (
62
- instr_using_strpos as instr,
63
- )
64
- from sqlframe.base.function_alternatives import (
65
- isnull_using_equal as isnull,
66
- )
67
- from sqlframe.base.function_alternatives import (
68
- last_day_with_cast as last_day,
69
- )
70
- from sqlframe.base.function_alternatives import (
71
- log1p_from_log as log1p,
72
- )
73
- from sqlframe.base.function_alternatives import (
74
- make_date_from_date_func as make_date,
75
- )
76
- from sqlframe.base.function_alternatives import (
77
- minute_from_extract as minute,
78
- )
79
- from sqlframe.base.function_alternatives import (
80
- month_from_extract as month,
81
- )
82
- from sqlframe.base.function_alternatives import (
83
- nanvl_as_case as nanvl,
84
- )
85
- from sqlframe.base.function_alternatives import (
86
- overlay_from_substr as overlay,
87
- )
88
- from sqlframe.base.function_alternatives import (
89
- percentile_approx_without_accuracy_and_plural as percentile_approx,
90
- )
91
- from sqlframe.base.function_alternatives import (
92
- position_as_strpos as position,
93
- )
94
- from sqlframe.base.function_alternatives import (
95
- quarter_from_extract as quarter,
96
- )
97
- from sqlframe.base.function_alternatives import (
98
- rand_no_seed as rand,
99
- )
100
- from sqlframe.base.function_alternatives import (
101
- regexp_extract_only_one_group as regexp_extract,
102
- )
103
- from sqlframe.base.function_alternatives import (
104
- rint_from_round as rint,
105
- )
106
- from sqlframe.base.function_alternatives import (
107
- second_from_extract as second,
108
- )
109
- from sqlframe.base.function_alternatives import (
110
- sequence_from_generate_array as sequence,
111
- )
112
- from sqlframe.base.function_alternatives import (
113
- sha1_force_sha1_and_to_hex as sha1,
114
- )
115
- from sqlframe.base.function_alternatives import (
116
- split_with_split as split,
117
- )
118
- from sqlframe.base.function_alternatives import (
119
- to_date_from_timestamp as to_date,
120
- )
121
- from sqlframe.base.function_alternatives import (
122
- weekofyear_from_extract_as_isoweek as weekofyear,
123
- )
124
- from sqlframe.base.function_alternatives import (
125
- year_from_extract as year,
126
- )
127
1
  from sqlframe.base.functions import abs as abs
128
2
  from sqlframe.base.functions import acos as acos
129
3
  from sqlframe.base.functions import acosh as acosh
130
4
  from sqlframe.base.functions import add_months as add_months
5
+ from sqlframe.base.functions import any_value as any_value
131
6
  from sqlframe.base.functions import approx_count_distinct as approx_count_distinct
132
7
  from sqlframe.base.functions import approxCountDistinct as approxCountDistinct
133
8
  from sqlframe.base.functions import array as array
9
+ from sqlframe.base.functions import array_append as array_append
134
10
  from sqlframe.base.functions import array_contains as array_contains
11
+ from sqlframe.base.functions import array_distinct as array_distinct
135
12
  from sqlframe.base.functions import array_join as array_join
13
+ from sqlframe.base.functions import array_max as array_max
14
+ from sqlframe.base.functions import array_min as array_min
15
+ from sqlframe.base.functions import array_position as array_position
16
+ from sqlframe.base.functions import array_remove as array_remove
17
+ from sqlframe.base.functions import array_sort as array_sort
18
+ from sqlframe.base.functions import array_union as array_union
136
19
  from sqlframe.base.functions import asc as asc
137
20
  from sqlframe.base.functions import asc_nulls_first as asc_nulls_first
138
21
  from sqlframe.base.functions import asc_nulls_last as asc_nulls_last
@@ -143,10 +26,14 @@ from sqlframe.base.functions import atan as atan
143
26
  from sqlframe.base.functions import atan2 as atan2
144
27
  from sqlframe.base.functions import atanh as atanh
145
28
  from sqlframe.base.functions import avg as avg
29
+ from sqlframe.base.functions import base64 as base64
30
+ from sqlframe.base.functions import bin as bin
31
+ from sqlframe.base.functions import bit_length as bit_length
146
32
  from sqlframe.base.functions import bitwise_not as bitwise_not
147
33
  from sqlframe.base.functions import bitwiseNOT as bitwiseNOT
148
34
  from sqlframe.base.functions import bool_and as bool_and
149
35
  from sqlframe.base.functions import bool_or as bool_or
36
+ from sqlframe.base.functions import bround as bround
150
37
  from sqlframe.base.functions import call_function as call_function
151
38
  from sqlframe.base.functions import cbrt as cbrt
152
39
  from sqlframe.base.functions import ceil as ceil
@@ -155,7 +42,9 @@ from sqlframe.base.functions import char as char
155
42
  from sqlframe.base.functions import coalesce as coalesce
156
43
  from sqlframe.base.functions import col as col
157
44
  from sqlframe.base.functions import collect_list as collect_list
45
+ from sqlframe.base.functions import collect_set as collect_set
158
46
  from sqlframe.base.functions import concat as concat
47
+ from sqlframe.base.functions import concat_ws as concat_ws
159
48
  from sqlframe.base.functions import corr as corr
160
49
  from sqlframe.base.functions import cos as cos
161
50
  from sqlframe.base.functions import cosh as cosh
@@ -168,6 +57,7 @@ from sqlframe.base.functions import csc as csc
168
57
  from sqlframe.base.functions import cume_dist as cume_dist
169
58
  from sqlframe.base.functions import current_date as current_date
170
59
  from sqlframe.base.functions import current_timestamp as current_timestamp
60
+ from sqlframe.base.functions import current_user as current_user
171
61
  from sqlframe.base.functions import date_add as date_add
172
62
  from sqlframe.base.functions import date_diff as date_diff
173
63
  from sqlframe.base.functions import date_format as date_format
@@ -175,22 +65,41 @@ from sqlframe.base.functions import date_sub as date_sub
175
65
  from sqlframe.base.functions import date_trunc as date_trunc
176
66
  from sqlframe.base.functions import dateadd as dateadd
177
67
  from sqlframe.base.functions import datediff as datediff
68
+ from sqlframe.base.functions import dayofmonth as dayofmonth
69
+ from sqlframe.base.functions import dayofweek as dayofweek
70
+ from sqlframe.base.functions import dayofyear as dayofyear
71
+ from sqlframe.base.functions import degrees as degrees
178
72
  from sqlframe.base.functions import dense_rank as dense_rank
179
73
  from sqlframe.base.functions import desc as desc
180
74
  from sqlframe.base.functions import desc_nulls_first as desc_nulls_first
181
75
  from sqlframe.base.functions import desc_nulls_last as desc_nulls_last
76
+ from sqlframe.base.functions import e as e
77
+ from sqlframe.base.functions import element_at as element_at
78
+ from sqlframe.base.functions import endswith as endswith
182
79
  from sqlframe.base.functions import exp as exp
183
80
  from sqlframe.base.functions import explode as explode
184
81
  from sqlframe.base.functions import explode_outer as explode_outer
82
+ from sqlframe.base.functions import expm1 as expm1
185
83
  from sqlframe.base.functions import expr as expr
84
+ from sqlframe.base.functions import extract as extract
85
+ from sqlframe.base.functions import factorial as factorial
186
86
  from sqlframe.base.functions import floor as floor
87
+ from sqlframe.base.functions import format_number as format_number
88
+ from sqlframe.base.functions import format_string as format_string
89
+ from sqlframe.base.functions import from_unixtime as from_unixtime
187
90
  from sqlframe.base.functions import get_json_object as get_json_object
188
91
  from sqlframe.base.functions import greatest as greatest
92
+ from sqlframe.base.functions import hash as hash
93
+ from sqlframe.base.functions import hex as hex
94
+ from sqlframe.base.functions import hour as hour
189
95
  from sqlframe.base.functions import ifnull as ifnull
190
96
  from sqlframe.base.functions import initcap as initcap
191
97
  from sqlframe.base.functions import input_file_name as input_file_name
98
+ from sqlframe.base.functions import instr as instr
192
99
  from sqlframe.base.functions import isnan as isnan
100
+ from sqlframe.base.functions import isnull as isnull
193
101
  from sqlframe.base.functions import lag as lag
102
+ from sqlframe.base.functions import last_day as last_day
194
103
  from sqlframe.base.functions import lcase as lcase
195
104
  from sqlframe.base.functions import lead as lead
196
105
  from sqlframe.base.functions import least as least
@@ -199,17 +108,24 @@ from sqlframe.base.functions import length as length
199
108
  from sqlframe.base.functions import lit as lit
200
109
  from sqlframe.base.functions import ln as ln
201
110
  from sqlframe.base.functions import log as log
111
+ from sqlframe.base.functions import log1p as log1p
202
112
  from sqlframe.base.functions import log2 as log2
203
113
  from sqlframe.base.functions import log10 as log10
204
114
  from sqlframe.base.functions import lower as lower
205
115
  from sqlframe.base.functions import lpad as lpad
206
116
  from sqlframe.base.functions import ltrim as ltrim
117
+ from sqlframe.base.functions import make_date as make_date
207
118
  from sqlframe.base.functions import max as max
208
119
  from sqlframe.base.functions import max_by as max_by
209
120
  from sqlframe.base.functions import md5 as md5
210
121
  from sqlframe.base.functions import mean as mean
211
122
  from sqlframe.base.functions import min as min
212
123
  from sqlframe.base.functions import min_by as min_by
124
+ from sqlframe.base.functions import minute as minute
125
+ from sqlframe.base.functions import month as month
126
+ from sqlframe.base.functions import months_between as months_between
127
+ from sqlframe.base.functions import nanvl as nanvl
128
+ from sqlframe.base.functions import next_day as next_day
213
129
  from sqlframe.base.functions import now as now
214
130
  from sqlframe.base.functions import nth_value as nth_value
215
131
  from sqlframe.base.functions import ntile as ntile
@@ -217,24 +133,35 @@ from sqlframe.base.functions import nullif as nullif
217
133
  from sqlframe.base.functions import nvl as nvl
218
134
  from sqlframe.base.functions import nvl2 as nvl2
219
135
  from sqlframe.base.functions import octet_length as octet_length
136
+ from sqlframe.base.functions import overlay as overlay
220
137
  from sqlframe.base.functions import percent_rank as percent_rank
138
+ from sqlframe.base.functions import percentile_approx as percentile_approx
221
139
  from sqlframe.base.functions import posexplode as posexplode
222
140
  from sqlframe.base.functions import posexplode_outer as posexplode_outer
141
+ from sqlframe.base.functions import position as position
223
142
  from sqlframe.base.functions import pow as pow
224
143
  from sqlframe.base.functions import power as power
144
+ from sqlframe.base.functions import quarter as quarter
145
+ from sqlframe.base.functions import radians as radians
146
+ from sqlframe.base.functions import rand as rand
225
147
  from sqlframe.base.functions import rank as rank
148
+ from sqlframe.base.functions import regexp_extract as regexp_extract
226
149
  from sqlframe.base.functions import regexp_like as regexp_like
227
150
  from sqlframe.base.functions import regexp_replace as regexp_replace
228
151
  from sqlframe.base.functions import repeat as repeat
229
152
  from sqlframe.base.functions import reverse as reverse
230
153
  from sqlframe.base.functions import right as right
154
+ from sqlframe.base.functions import rint as rint
231
155
  from sqlframe.base.functions import rlike as rlike
232
156
  from sqlframe.base.functions import round as round
233
157
  from sqlframe.base.functions import row_number as row_number
234
158
  from sqlframe.base.functions import rpad as rpad
235
159
  from sqlframe.base.functions import rtrim as rtrim
236
160
  from sqlframe.base.functions import sec as sec
161
+ from sqlframe.base.functions import second as second
162
+ from sqlframe.base.functions import sequence as sequence
237
163
  from sqlframe.base.functions import sha as sha
164
+ from sqlframe.base.functions import sha1 as sha1
238
165
  from sqlframe.base.functions import shiftLeft as shiftLeft
239
166
  from sqlframe.base.functions import shiftleft as shiftleft
240
167
  from sqlframe.base.functions import shiftRight as shiftRight
@@ -244,7 +171,10 @@ from sqlframe.base.functions import signum as signum
244
171
  from sqlframe.base.functions import sin as sin
245
172
  from sqlframe.base.functions import sinh as sinh
246
173
  from sqlframe.base.functions import size as size
174
+ from sqlframe.base.functions import slice as slice
175
+ from sqlframe.base.functions import sort_array as sort_array
247
176
  from sqlframe.base.functions import soundex as soundex
177
+ from sqlframe.base.functions import split as split
248
178
  from sqlframe.base.functions import sqrt as sqrt
249
179
  from sqlframe.base.functions import startswith as startswith
250
180
  from sqlframe.base.functions import stddev as stddev
@@ -253,54 +183,31 @@ from sqlframe.base.functions import stddev_samp as stddev_samp
253
183
  from sqlframe.base.functions import struct as struct
254
184
  from sqlframe.base.functions import substr as substr
255
185
  from sqlframe.base.functions import substring as substring
186
+ from sqlframe.base.functions import substring_index as substring_index
256
187
  from sqlframe.base.functions import sum as sum
257
188
  from sqlframe.base.functions import sum_distinct as sum_distinct
258
189
  from sqlframe.base.functions import sumDistinct as sumDistinct
259
190
  from sqlframe.base.functions import tan as tan
260
191
  from sqlframe.base.functions import tanh as tanh
261
192
  from sqlframe.base.functions import timestamp_seconds as timestamp_seconds
193
+ from sqlframe.base.functions import to_date as to_date
262
194
  from sqlframe.base.functions import to_timestamp as to_timestamp
263
195
  from sqlframe.base.functions import toDegrees as toDegrees
264
196
  from sqlframe.base.functions import toRadians as toRadians
265
197
  from sqlframe.base.functions import translate as translate
266
198
  from sqlframe.base.functions import trim as trim
267
199
  from sqlframe.base.functions import trunc as trunc
200
+ from sqlframe.base.functions import try_to_timestamp as try_to_timestamp
201
+ from sqlframe.base.functions import typeof as typeof
268
202
  from sqlframe.base.functions import ucase as ucase
269
203
  from sqlframe.base.functions import unbase64 as unbase64
270
204
  from sqlframe.base.functions import unhex as unhex
205
+ from sqlframe.base.functions import unix_timestamp as unix_timestamp
271
206
  from sqlframe.base.functions import upper as upper
272
207
  from sqlframe.base.functions import user as user
273
208
  from sqlframe.base.functions import var_pop as var_pop
274
209
  from sqlframe.base.functions import var_samp as var_samp
275
210
  from sqlframe.base.functions import variance as variance
211
+ from sqlframe.base.functions import weekofyear as weekofyear
276
212
  from sqlframe.base.functions import when as when
277
- from sqlframe.base.util import get_func_from_session as get_func_from_session
278
-
279
- if t.TYPE_CHECKING:
280
- from sqlframe.base._typing import ColumnOrLiteral, ColumnOrName
281
-
282
- def array_distinct(col: ColumnOrName) -> Column: ...
283
- def array_max(col: ColumnOrName) -> Column: ...
284
- def array_min(col: ColumnOrName) -> Column: ...
285
- def array_position(col: ColumnOrName, value: ColumnOrLiteral) -> Column: ...
286
- def array_remove(col: ColumnOrName, value: ColumnOrLiteral) -> Column: ...
287
- def array_sort(col: ColumnOrName, asc: t.Optional[bool] = ...) -> Column: ...
288
- def bin(col: ColumnOrName) -> Column: ...
289
- def bround(col: ColumnOrName, scale: t.Optional[int] = ...) -> Column: ...
290
- def degrees(col: ColumnOrName) -> Column: ...
291
- def format_number(col: ColumnOrName, d: int) -> Column: ...
292
- def from_unixtime(col: ColumnOrName, format: t.Optional[str] = ...) -> Column: ...
293
- def months_between(
294
- date1: ColumnOrName, date2: ColumnOrName, roundOff: t.Optional[bool] = ...
295
- ) -> Column: ...
296
- def next_day(col: ColumnOrName, dayOfWeek: str) -> Column: ...
297
- def radians(col: ColumnOrName) -> Column: ...
298
- def slice(
299
- x: ColumnOrName, start: t.Union[ColumnOrName, int], length: t.Union[ColumnOrName, int]
300
- ) -> Column: ...
301
- def sort_array(col: ColumnOrName, asc: t.Optional[bool] = ...) -> Column: ...
302
- def substring_index(str: ColumnOrName, delim: str, count: int) -> Column: ...
303
- def typeof(col: ColumnOrName) -> Column: ...
304
- def unix_timestamp(
305
- timestamp: t.Optional[ColumnOrName] = ..., format: t.Optional[str] = ...
306
- ) -> Column: ...
213
+ from sqlframe.base.functions import year as year
@@ -76,6 +76,10 @@ class BigQuerySession(
76
76
  def _try_get_map(cls, value: t.Any) -> t.Optional[t.Dict[str, t.Any]]:
77
77
  return None
78
78
 
79
+ @property
80
+ def _is_bigquery(self) -> bool:
81
+ return True
82
+
79
83
  class Builder(_BaseSession.Builder):
80
84
  DEFAULT_EXECUTION_DIALECT = "bigquery"
81
85
 
@@ -11,13 +11,3 @@ globals().update(
11
11
  if hasattr(func, "unsupported_engines") and "databricks" not in func.unsupported_engines
12
12
  }
13
13
  )
14
-
15
-
16
- from sqlframe.base.function_alternatives import ( # noqa
17
- percentile_without_disc as percentile,
18
- add_months_by_multiplication as add_months,
19
- arrays_overlap_renamed as arrays_overlap,
20
- _is_string_using_typeof_string_lcase as _is_string,
21
- try_element_at_zero_based as try_element_at,
22
- get_json_object_using_function as get_json_object,
23
- )