sqlframe 3.10.1__py3-none-any.whl → 3.12.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.
- sqlframe/_version.py +2 -2
- sqlframe/base/column.py +11 -8
- sqlframe/base/dataframe.py +5 -3
- sqlframe/base/decorators.py +41 -2
- sqlframe/base/function_alternatives.py +445 -404
- sqlframe/base/functions.py +1100 -73
- sqlframe/base/mixins/dataframe_mixins.py +3 -3
- sqlframe/base/operations.py +5 -5
- sqlframe/base/session.py +36 -4
- sqlframe/bigquery/dataframe.py +2 -2
- sqlframe/bigquery/functions.py +1 -361
- sqlframe/bigquery/functions.pyi +63 -156
- sqlframe/bigquery/session.py +4 -0
- sqlframe/databricks/dataframe.py +2 -2
- sqlframe/databricks/functions.py +0 -10
- sqlframe/databricks/functions.pyi +405 -413
- sqlframe/databricks/session.py +4 -0
- sqlframe/duckdb/dataframe.py +2 -2
- sqlframe/duckdb/functions.py +0 -40
- sqlframe/duckdb/functions.pyi +219 -216
- sqlframe/duckdb/session.py +4 -0
- sqlframe/postgres/dataframe.py +2 -2
- sqlframe/postgres/functions.py +1 -60
- sqlframe/postgres/functions.pyi +197 -196
- sqlframe/postgres/session.py +4 -0
- sqlframe/redshift/dataframe.py +2 -2
- sqlframe/redshift/functions.py +1 -4
- sqlframe/redshift/session.py +4 -0
- sqlframe/snowflake/dataframe.py +2 -2
- sqlframe/snowflake/functions.py +1 -55
- sqlframe/snowflake/functions.pyi +224 -220
- sqlframe/snowflake/session.py +4 -0
- sqlframe/spark/dataframe.py +2 -2
- sqlframe/spark/functions.py +0 -9
- sqlframe/spark/functions.pyi +411 -413
- sqlframe/spark/session.py +4 -0
- sqlframe/standalone/dataframe.py +2 -2
- sqlframe/standalone/functions.py +1 -1
- sqlframe/standalone/session.py +4 -0
- sqlframe/testing/utils.py +3 -3
- {sqlframe-3.10.1.dist-info → sqlframe-3.12.0.dist-info}/METADATA +2 -2
- {sqlframe-3.10.1.dist-info → sqlframe-3.12.0.dist-info}/RECORD +45 -45
- {sqlframe-3.10.1.dist-info → sqlframe-3.12.0.dist-info}/LICENSE +0 -0
- {sqlframe-3.10.1.dist-info → sqlframe-3.12.0.dist-info}/WHEEL +0 -0
- {sqlframe-3.10.1.dist-info → sqlframe-3.12.0.dist-info}/top_level.txt +0 -0
sqlframe/databricks/session.py
CHANGED
sqlframe/duckdb/dataframe.py
CHANGED
|
@@ -4,7 +4,7 @@ import logging
|
|
|
4
4
|
import typing as t
|
|
5
5
|
|
|
6
6
|
from sqlframe.base.dataframe import (
|
|
7
|
-
|
|
7
|
+
BaseDataFrame,
|
|
8
8
|
_BaseDataFrameNaFunctions,
|
|
9
9
|
_BaseDataFrameStatFunctions,
|
|
10
10
|
)
|
|
@@ -34,7 +34,7 @@ class DuckDBDataFrameStatFunctions(_BaseDataFrameStatFunctions["DuckDBDataFrame"
|
|
|
34
34
|
class DuckDBDataFrame(
|
|
35
35
|
NoCachePersistSupportMixin,
|
|
36
36
|
TypedColumnsFromTempViewMixin,
|
|
37
|
-
|
|
37
|
+
BaseDataFrame[
|
|
38
38
|
"DuckDBSession",
|
|
39
39
|
"DuckDBDataFrameWriter",
|
|
40
40
|
"DuckDBDataFrameNaFunctions",
|
sqlframe/duckdb/functions.py
CHANGED
|
@@ -15,43 +15,3 @@ globals().update(
|
|
|
15
15
|
and "*" not in func.unsupported_engines
|
|
16
16
|
}
|
|
17
17
|
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
from sqlframe.base.function_alternatives import ( # noqa
|
|
21
|
-
any_value_always_ignore_nulls as any_value,
|
|
22
|
-
e_literal as e,
|
|
23
|
-
expm1_from_exp as expm1,
|
|
24
|
-
log1p_from_log as log1p,
|
|
25
|
-
rint_from_round as rint,
|
|
26
|
-
kurtosis_from_kurtosis_pop as kurtosis,
|
|
27
|
-
collect_set_from_list_distinct as collect_set,
|
|
28
|
-
first_always_ignore_nulls as first,
|
|
29
|
-
factorial_ensure_int as factorial,
|
|
30
|
-
isnull_using_equal as isnull,
|
|
31
|
-
nanvl_as_case as nanvl,
|
|
32
|
-
percentile_approx_without_accuracy as percentile_approx,
|
|
33
|
-
rand_no_seed as rand,
|
|
34
|
-
base64_from_blob as base64,
|
|
35
|
-
decode_from_blob as decode,
|
|
36
|
-
format_string_with_pipes as format_string,
|
|
37
|
-
overlay_from_substr as overlay,
|
|
38
|
-
split_no_limit as split,
|
|
39
|
-
arrays_overlap_using_intersect as arrays_overlap,
|
|
40
|
-
slice_as_list_slice as slice,
|
|
41
|
-
array_join_null_replacement_with_transform as array_join,
|
|
42
|
-
element_at_using_brackets as element_at,
|
|
43
|
-
array_remove_using_filter as array_remove,
|
|
44
|
-
array_union_using_list_concat as array_union,
|
|
45
|
-
array_min_from_sort as array_min,
|
|
46
|
-
array_max_from_sort as array_max,
|
|
47
|
-
sequence_from_generate_series as sequence,
|
|
48
|
-
try_element_at_zero_based as try_element_at,
|
|
49
|
-
day_with_try_to_timestamp as day,
|
|
50
|
-
try_to_timestamp_strptime as try_to_timestamp,
|
|
51
|
-
_is_string_using_typeof_varchar as _is_string,
|
|
52
|
-
array_append_list_append as array_append,
|
|
53
|
-
endswith_with_underscore as endswith,
|
|
54
|
-
last_day_with_cast as last_day,
|
|
55
|
-
regexp_replace_global_option as regexp_replace,
|
|
56
|
-
to_timestamp_tz as to_timestamp,
|
|
57
|
-
)
|
sqlframe/duckdb/functions.pyi
CHANGED
|
@@ -1,216 +1,219 @@
|
|
|
1
|
-
from sqlframe.base.
|
|
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
|
-
from sqlframe.base.functions import
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
1
|
+
from sqlframe.base.functions import abs as abs
|
|
2
|
+
from sqlframe.base.functions import acos as acos
|
|
3
|
+
from sqlframe.base.functions import add_months as add_months
|
|
4
|
+
from sqlframe.base.functions import any_value as any_value
|
|
5
|
+
from sqlframe.base.functions import approx_count_distinct as approx_count_distinct
|
|
6
|
+
from sqlframe.base.functions import approxCountDistinct as approxCountDistinct
|
|
7
|
+
from sqlframe.base.functions import array as array
|
|
8
|
+
from sqlframe.base.functions import array_append as array_append
|
|
9
|
+
from sqlframe.base.functions import array_contains as array_contains
|
|
10
|
+
from sqlframe.base.functions import array_distinct as array_distinct
|
|
11
|
+
from sqlframe.base.functions import array_intersect as array_intersect
|
|
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
|
|
19
|
+
from sqlframe.base.functions import arrays_overlap as arrays_overlap
|
|
20
|
+
from sqlframe.base.functions import asc as asc
|
|
21
|
+
from sqlframe.base.functions import asc_nulls_first as asc_nulls_first
|
|
22
|
+
from sqlframe.base.functions import asc_nulls_last as asc_nulls_last
|
|
23
|
+
from sqlframe.base.functions import ascii as ascii
|
|
24
|
+
from sqlframe.base.functions import asin as asin
|
|
25
|
+
from sqlframe.base.functions import atan as atan
|
|
26
|
+
from sqlframe.base.functions import atan2 as atan2
|
|
27
|
+
from sqlframe.base.functions import avg as avg
|
|
28
|
+
from sqlframe.base.functions import base64 as base64
|
|
29
|
+
from sqlframe.base.functions import bin as bin
|
|
30
|
+
from sqlframe.base.functions import bit_length as bit_length
|
|
31
|
+
from sqlframe.base.functions import bitwise_not as bitwise_not
|
|
32
|
+
from sqlframe.base.functions import bitwiseNOT as bitwiseNOT
|
|
33
|
+
from sqlframe.base.functions import bool_and as bool_and
|
|
34
|
+
from sqlframe.base.functions import bool_or as bool_or
|
|
35
|
+
from sqlframe.base.functions import call_function as call_function
|
|
36
|
+
from sqlframe.base.functions import cbrt as cbrt
|
|
37
|
+
from sqlframe.base.functions import ceil as ceil
|
|
38
|
+
from sqlframe.base.functions import ceiling as ceiling
|
|
39
|
+
from sqlframe.base.functions import char as char
|
|
40
|
+
from sqlframe.base.functions import coalesce as coalesce
|
|
41
|
+
from sqlframe.base.functions import col as col
|
|
42
|
+
from sqlframe.base.functions import collect_list as collect_list
|
|
43
|
+
from sqlframe.base.functions import collect_set as collect_set
|
|
44
|
+
from sqlframe.base.functions import concat as concat
|
|
45
|
+
from sqlframe.base.functions import concat_ws as concat_ws
|
|
46
|
+
from sqlframe.base.functions import contains as contains
|
|
47
|
+
from sqlframe.base.functions import convert_timezone as convert_timezone
|
|
48
|
+
from sqlframe.base.functions import corr as corr
|
|
49
|
+
from sqlframe.base.functions import cos as cos
|
|
50
|
+
from sqlframe.base.functions import cot as cot
|
|
51
|
+
from sqlframe.base.functions import count as count
|
|
52
|
+
from sqlframe.base.functions import count_distinct as count_distinct
|
|
53
|
+
from sqlframe.base.functions import count_if as count_if
|
|
54
|
+
from sqlframe.base.functions import countDistinct as countDistinct
|
|
55
|
+
from sqlframe.base.functions import covar_pop as covar_pop
|
|
56
|
+
from sqlframe.base.functions import covar_samp as covar_samp
|
|
57
|
+
from sqlframe.base.functions import create_map as create_map
|
|
58
|
+
from sqlframe.base.functions import cume_dist as cume_dist
|
|
59
|
+
from sqlframe.base.functions import current_date as current_date
|
|
60
|
+
from sqlframe.base.functions import current_timestamp as current_timestamp
|
|
61
|
+
from sqlframe.base.functions import current_user as current_user
|
|
62
|
+
from sqlframe.base.functions import date_add as date_add
|
|
63
|
+
from sqlframe.base.functions import date_diff as date_diff
|
|
64
|
+
from sqlframe.base.functions import date_format as date_format
|
|
65
|
+
from sqlframe.base.functions import date_sub as date_sub
|
|
66
|
+
from sqlframe.base.functions import date_trunc as date_trunc
|
|
67
|
+
from sqlframe.base.functions import dateadd as dateadd
|
|
68
|
+
from sqlframe.base.functions import datediff as datediff
|
|
69
|
+
from sqlframe.base.functions import day as day
|
|
70
|
+
from sqlframe.base.functions import dayofmonth as dayofmonth
|
|
71
|
+
from sqlframe.base.functions import dayofweek as dayofweek
|
|
72
|
+
from sqlframe.base.functions import dayofyear as dayofyear
|
|
73
|
+
from sqlframe.base.functions import decode as decode
|
|
74
|
+
from sqlframe.base.functions import degrees as degrees
|
|
75
|
+
from sqlframe.base.functions import dense_rank as dense_rank
|
|
76
|
+
from sqlframe.base.functions import desc as desc
|
|
77
|
+
from sqlframe.base.functions import desc_nulls_first as desc_nulls_first
|
|
78
|
+
from sqlframe.base.functions import desc_nulls_last as desc_nulls_last
|
|
79
|
+
from sqlframe.base.functions import e as e
|
|
80
|
+
from sqlframe.base.functions import element_at as element_at
|
|
81
|
+
from sqlframe.base.functions import encode as encode
|
|
82
|
+
from sqlframe.base.functions import endswith as endswith
|
|
83
|
+
from sqlframe.base.functions import exp as exp
|
|
84
|
+
from sqlframe.base.functions import explode as explode
|
|
85
|
+
from sqlframe.base.functions import expm1 as expm1
|
|
86
|
+
from sqlframe.base.functions import expr as expr
|
|
87
|
+
from sqlframe.base.functions import extract as extract
|
|
88
|
+
from sqlframe.base.functions import factorial as factorial
|
|
89
|
+
from sqlframe.base.functions import first as first
|
|
90
|
+
from sqlframe.base.functions import flatten as flatten
|
|
91
|
+
from sqlframe.base.functions import floor as floor
|
|
92
|
+
from sqlframe.base.functions import format_string as format_string
|
|
93
|
+
from sqlframe.base.functions import from_unixtime as from_unixtime
|
|
94
|
+
from sqlframe.base.functions import get_json_object as get_json_object
|
|
95
|
+
from sqlframe.base.functions import greatest as greatest
|
|
96
|
+
from sqlframe.base.functions import grouping_id as grouping_id
|
|
97
|
+
from sqlframe.base.functions import hash as hash
|
|
98
|
+
from sqlframe.base.functions import hex as hex
|
|
99
|
+
from sqlframe.base.functions import hour as hour
|
|
100
|
+
from sqlframe.base.functions import ifnull as ifnull
|
|
101
|
+
from sqlframe.base.functions import input_file_name as input_file_name
|
|
102
|
+
from sqlframe.base.functions import instr as instr
|
|
103
|
+
from sqlframe.base.functions import isnan as isnan
|
|
104
|
+
from sqlframe.base.functions import isnull as isnull
|
|
105
|
+
from sqlframe.base.functions import kurtosis as kurtosis
|
|
106
|
+
from sqlframe.base.functions import lag as lag
|
|
107
|
+
from sqlframe.base.functions import last as last
|
|
108
|
+
from sqlframe.base.functions import last_day as last_day
|
|
109
|
+
from sqlframe.base.functions import lcase as lcase
|
|
110
|
+
from sqlframe.base.functions import lead as lead
|
|
111
|
+
from sqlframe.base.functions import least as least
|
|
112
|
+
from sqlframe.base.functions import left as left
|
|
113
|
+
from sqlframe.base.functions import length as length
|
|
114
|
+
from sqlframe.base.functions import levenshtein as levenshtein
|
|
115
|
+
from sqlframe.base.functions import lit as lit
|
|
116
|
+
from sqlframe.base.functions import ln as ln
|
|
117
|
+
from sqlframe.base.functions import locate as locate
|
|
118
|
+
from sqlframe.base.functions import log as log
|
|
119
|
+
from sqlframe.base.functions import log1p as log1p
|
|
120
|
+
from sqlframe.base.functions import log2 as log2
|
|
121
|
+
from sqlframe.base.functions import log10 as log10
|
|
122
|
+
from sqlframe.base.functions import lower as lower
|
|
123
|
+
from sqlframe.base.functions import lpad as lpad
|
|
124
|
+
from sqlframe.base.functions import ltrim as ltrim
|
|
125
|
+
from sqlframe.base.functions import make_date as make_date
|
|
126
|
+
from sqlframe.base.functions import map_from_arrays as map_from_arrays
|
|
127
|
+
from sqlframe.base.functions import max as max
|
|
128
|
+
from sqlframe.base.functions import max_by as max_by
|
|
129
|
+
from sqlframe.base.functions import md5 as md5
|
|
130
|
+
from sqlframe.base.functions import mean as mean
|
|
131
|
+
from sqlframe.base.functions import median as median
|
|
132
|
+
from sqlframe.base.functions import min as min
|
|
133
|
+
from sqlframe.base.functions import min_by as min_by
|
|
134
|
+
from sqlframe.base.functions import minute as minute
|
|
135
|
+
from sqlframe.base.functions import month as month
|
|
136
|
+
from sqlframe.base.functions import months_between as months_between
|
|
137
|
+
from sqlframe.base.functions import nanvl as nanvl
|
|
138
|
+
from sqlframe.base.functions import now as now
|
|
139
|
+
from sqlframe.base.functions import nth_value as nth_value
|
|
140
|
+
from sqlframe.base.functions import ntile as ntile
|
|
141
|
+
from sqlframe.base.functions import nullif as nullif
|
|
142
|
+
from sqlframe.base.functions import nvl as nvl
|
|
143
|
+
from sqlframe.base.functions import nvl2 as nvl2
|
|
144
|
+
from sqlframe.base.functions import overlay as overlay
|
|
145
|
+
from sqlframe.base.functions import percent_rank as percent_rank
|
|
146
|
+
from sqlframe.base.functions import percentile as percentile
|
|
147
|
+
from sqlframe.base.functions import percentile_approx as percentile_approx
|
|
148
|
+
from sqlframe.base.functions import position as position
|
|
149
|
+
from sqlframe.base.functions import pow as pow
|
|
150
|
+
from sqlframe.base.functions import power as power
|
|
151
|
+
from sqlframe.base.functions import quarter as quarter
|
|
152
|
+
from sqlframe.base.functions import radians as radians
|
|
153
|
+
from sqlframe.base.functions import rand as rand
|
|
154
|
+
from sqlframe.base.functions import rank as rank
|
|
155
|
+
from sqlframe.base.functions import regexp_extract as regexp_extract
|
|
156
|
+
from sqlframe.base.functions import regexp_like as regexp_like
|
|
157
|
+
from sqlframe.base.functions import regexp_replace as regexp_replace
|
|
158
|
+
from sqlframe.base.functions import repeat as repeat
|
|
159
|
+
from sqlframe.base.functions import reverse as reverse
|
|
160
|
+
from sqlframe.base.functions import right as right
|
|
161
|
+
from sqlframe.base.functions import rint as rint
|
|
162
|
+
from sqlframe.base.functions import rlike as rlike
|
|
163
|
+
from sqlframe.base.functions import round as round
|
|
164
|
+
from sqlframe.base.functions import row_number as row_number
|
|
165
|
+
from sqlframe.base.functions import rpad as rpad
|
|
166
|
+
from sqlframe.base.functions import rtrim as rtrim
|
|
167
|
+
from sqlframe.base.functions import second as second
|
|
168
|
+
from sqlframe.base.functions import sequence as sequence
|
|
169
|
+
from sqlframe.base.functions import shiftLeft as shiftLeft
|
|
170
|
+
from sqlframe.base.functions import shiftleft as shiftleft
|
|
171
|
+
from sqlframe.base.functions import shiftRight as shiftRight
|
|
172
|
+
from sqlframe.base.functions import shiftright as shiftright
|
|
173
|
+
from sqlframe.base.functions import sign as sign
|
|
174
|
+
from sqlframe.base.functions import signum as signum
|
|
175
|
+
from sqlframe.base.functions import sin as sin
|
|
176
|
+
from sqlframe.base.functions import size as size
|
|
177
|
+
from sqlframe.base.functions import skewness as skewness
|
|
178
|
+
from sqlframe.base.functions import slice as slice
|
|
179
|
+
from sqlframe.base.functions import sort_array as sort_array
|
|
180
|
+
from sqlframe.base.functions import soundex as soundex
|
|
181
|
+
from sqlframe.base.functions import split as split
|
|
182
|
+
from sqlframe.base.functions import split_part as split_part
|
|
183
|
+
from sqlframe.base.functions import sqrt as sqrt
|
|
184
|
+
from sqlframe.base.functions import startswith as startswith
|
|
185
|
+
from sqlframe.base.functions import stddev as stddev
|
|
186
|
+
from sqlframe.base.functions import stddev_pop as stddev_pop
|
|
187
|
+
from sqlframe.base.functions import stddev_samp as stddev_samp
|
|
188
|
+
from sqlframe.base.functions import struct as struct
|
|
189
|
+
from sqlframe.base.functions import substr as substr
|
|
190
|
+
from sqlframe.base.functions import substring as substring
|
|
191
|
+
from sqlframe.base.functions import sum as sum
|
|
192
|
+
from sqlframe.base.functions import sum_distinct as sum_distinct
|
|
193
|
+
from sqlframe.base.functions import sumDistinct as sumDistinct
|
|
194
|
+
from sqlframe.base.functions import tan as tan
|
|
195
|
+
from sqlframe.base.functions import timestamp_seconds as timestamp_seconds
|
|
196
|
+
from sqlframe.base.functions import to_date as to_date
|
|
197
|
+
from sqlframe.base.functions import to_timestamp as to_timestamp
|
|
198
|
+
from sqlframe.base.functions import to_unix_timestamp as to_unix_timestamp
|
|
199
|
+
from sqlframe.base.functions import toDegrees as toDegrees
|
|
200
|
+
from sqlframe.base.functions import toRadians as toRadians
|
|
201
|
+
from sqlframe.base.functions import translate as translate
|
|
202
|
+
from sqlframe.base.functions import trim as trim
|
|
203
|
+
from sqlframe.base.functions import trunc as trunc
|
|
204
|
+
from sqlframe.base.functions import try_element_at as try_element_at
|
|
205
|
+
from sqlframe.base.functions import try_to_timestamp as try_to_timestamp
|
|
206
|
+
from sqlframe.base.functions import typeof as typeof
|
|
207
|
+
from sqlframe.base.functions import ucase as ucase
|
|
208
|
+
from sqlframe.base.functions import unbase64 as unbase64
|
|
209
|
+
from sqlframe.base.functions import unhex as unhex
|
|
210
|
+
from sqlframe.base.functions import unix_date as unix_date
|
|
211
|
+
from sqlframe.base.functions import unix_timestamp as unix_timestamp
|
|
212
|
+
from sqlframe.base.functions import upper as upper
|
|
213
|
+
from sqlframe.base.functions import user as user
|
|
214
|
+
from sqlframe.base.functions import var_pop as var_pop
|
|
215
|
+
from sqlframe.base.functions import var_samp as var_samp
|
|
216
|
+
from sqlframe.base.functions import variance as variance
|
|
217
|
+
from sqlframe.base.functions import weekofyear as weekofyear
|
|
218
|
+
from sqlframe.base.functions import when as when
|
|
219
|
+
from sqlframe.base.functions import year as year
|
sqlframe/duckdb/session.py
CHANGED
|
@@ -71,6 +71,10 @@ class DuckDBSession(
|
|
|
71
71
|
def _execute(self, sql: str) -> None:
|
|
72
72
|
self._last_result = self._cur.execute(sql) # type: ignore
|
|
73
73
|
|
|
74
|
+
@property
|
|
75
|
+
def _is_duckdb(self) -> bool:
|
|
76
|
+
return True
|
|
77
|
+
|
|
74
78
|
class Builder(_BaseSession.Builder):
|
|
75
79
|
DEFAULT_EXECUTION_DIALECT = "duckdb"
|
|
76
80
|
|
sqlframe/postgres/dataframe.py
CHANGED
|
@@ -5,7 +5,7 @@ import sys
|
|
|
5
5
|
import typing as t
|
|
6
6
|
|
|
7
7
|
from sqlframe.base.dataframe import (
|
|
8
|
-
|
|
8
|
+
BaseDataFrame,
|
|
9
9
|
_BaseDataFrameNaFunctions,
|
|
10
10
|
_BaseDataFrameStatFunctions,
|
|
11
11
|
)
|
|
@@ -39,7 +39,7 @@ class PostgresDataFrameStatFunctions(_BaseDataFrameStatFunctions["PostgresDataFr
|
|
|
39
39
|
class PostgresDataFrame(
|
|
40
40
|
NoCachePersistSupportMixin,
|
|
41
41
|
TypedColumnsFromTempViewMixin,
|
|
42
|
-
|
|
42
|
+
BaseDataFrame[
|
|
43
43
|
"PostgresSession",
|
|
44
44
|
"PostgresDataFrameWriter",
|
|
45
45
|
"PostgresDataFrameNaFunctions",
|
sqlframe/postgres/functions.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
import sys
|
|
3
3
|
|
|
4
|
-
import sqlframe.base.functions
|
|
4
|
+
import sqlframe.base.functions # noqa
|
|
5
5
|
|
|
6
6
|
module = sys.modules["sqlframe.base.functions"]
|
|
7
7
|
globals().update(
|
|
@@ -13,62 +13,3 @@ globals().update(
|
|
|
13
13
|
and "*" not in func.unsupported_engines
|
|
14
14
|
}
|
|
15
15
|
)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
from sqlframe.base.function_alternatives import ( # noqa
|
|
19
|
-
any_value_ignore_nulls_not_supported as any_value,
|
|
20
|
-
e_literal as e,
|
|
21
|
-
expm1_from_exp as expm1,
|
|
22
|
-
log1p_from_log as log1p,
|
|
23
|
-
rint_from_round as rint,
|
|
24
|
-
collect_set_from_list_distinct as collect_set,
|
|
25
|
-
isnan_using_equal as isnan,
|
|
26
|
-
isnull_using_equal as isnull,
|
|
27
|
-
nanvl_as_case as nanvl,
|
|
28
|
-
rand_no_seed as rand,
|
|
29
|
-
round_cast_as_numeric as round,
|
|
30
|
-
year_from_extract as year,
|
|
31
|
-
quarter_from_extract as quarter,
|
|
32
|
-
month_from_extract as month,
|
|
33
|
-
dayofweek_from_extract_with_isodow as dayofweek,
|
|
34
|
-
dayofmonth_from_extract_with_day as dayofmonth,
|
|
35
|
-
dayofyear_from_extract_doy as dayofyear,
|
|
36
|
-
hour_from_extract as hour,
|
|
37
|
-
minute_from_extract as minute,
|
|
38
|
-
second_from_extract as second,
|
|
39
|
-
weekofyear_from_extract_as_week as weekofyear,
|
|
40
|
-
make_date_casted_as_integer as make_date,
|
|
41
|
-
date_add_by_multiplication as date_add,
|
|
42
|
-
date_sub_by_multiplication as date_sub,
|
|
43
|
-
date_diff_with_subtraction as date_diff,
|
|
44
|
-
date_diff_with_subtraction as datediff,
|
|
45
|
-
add_months_by_multiplication as add_months,
|
|
46
|
-
months_between_from_age_and_extract as months_between,
|
|
47
|
-
from_unixtime_from_timestamp as from_unixtime,
|
|
48
|
-
unix_timestamp_from_extract as unix_timestamp,
|
|
49
|
-
base64_from_blob as base64,
|
|
50
|
-
bas64_from_encode as base64,
|
|
51
|
-
unbase64_from_decode as unbase64,
|
|
52
|
-
decode_from_convert_from as decode,
|
|
53
|
-
encode_from_convert_to as encode,
|
|
54
|
-
format_number_from_to_char as format_number,
|
|
55
|
-
format_string_with_format as format_string,
|
|
56
|
-
split_from_regex_split_to_array as split,
|
|
57
|
-
array_contains_any as array_contains,
|
|
58
|
-
slice_with_brackets as slice,
|
|
59
|
-
element_at_using_brackets as element_at,
|
|
60
|
-
get_json_object_using_arrow_op as get_json_object,
|
|
61
|
-
array_min_from_subquery as array_min,
|
|
62
|
-
array_max_from_subquery as array_max,
|
|
63
|
-
left_cast_len as left,
|
|
64
|
-
right_cast_len as right,
|
|
65
|
-
position_cast_start as position,
|
|
66
|
-
try_element_at_zero_based as try_element_at,
|
|
67
|
-
try_to_timestamp_pgtemp as try_to_timestamp,
|
|
68
|
-
typeof_pg_typeof as typeof,
|
|
69
|
-
_is_string_using_typeof_char_varying as _is_string,
|
|
70
|
-
endswith_using_like as endswith,
|
|
71
|
-
last_day_with_cast as last_day,
|
|
72
|
-
regexp_replace_global_option as regexp_replace,
|
|
73
|
-
to_timestamp_with_time_zone as to_timestamp,
|
|
74
|
-
)
|