sqlframe 3.31.2__py3-none-any.whl → 3.31.4__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/functions.py +7 -6
- sqlframe/base/session.py +0 -2
- sqlframe/base/util.py +1 -1
- sqlframe/duckdb/session.py +2 -1
- {sqlframe-3.31.2.dist-info → sqlframe-3.31.4.dist-info}/METADATA +4 -4
- {sqlframe-3.31.2.dist-info → sqlframe-3.31.4.dist-info}/RECORD +10 -10
- {sqlframe-3.31.2.dist-info → sqlframe-3.31.4.dist-info}/LICENSE +0 -0
- {sqlframe-3.31.2.dist-info → sqlframe-3.31.4.dist-info}/WHEEL +0 -0
- {sqlframe-3.31.2.dist-info → sqlframe-3.31.4.dist-info}/top_level.txt +0 -0
sqlframe/_version.py
CHANGED
sqlframe/base/functions.py
CHANGED
@@ -500,15 +500,16 @@ def skewness(col: ColumnOrName) -> Column:
|
|
500
500
|
lit_func = get_func_from_session("lit")
|
501
501
|
sqrt_func = get_func_from_session("sqrt")
|
502
502
|
col = Column.ensure_col(col)
|
503
|
+
full_calc = (
|
504
|
+
Column.invoke_anonymous_function(col, func_name)
|
505
|
+
* (count_star - lit_func(2))
|
506
|
+
/ (sqrt_func(count_star * (count_star - lit_func(1))))
|
507
|
+
)
|
503
508
|
return (
|
504
509
|
when_func(count_star == lit_func(0), lit_func(None))
|
505
510
|
.when(count_star == lit_func(1), lit_func(float("nan")))
|
506
|
-
.when(count_star == lit_func(2), lit_func(
|
507
|
-
.otherwise(
|
508
|
-
Column.invoke_anonymous_function(col, func_name)
|
509
|
-
* (count_star - lit_func(2))
|
510
|
-
/ (sqrt_func(count_star * (count_star - lit_func(1))))
|
511
|
-
)
|
511
|
+
.when(count_star == lit_func(2), lit_func(None))
|
512
|
+
.otherwise(full_calc)
|
512
513
|
)
|
513
514
|
|
514
515
|
return Column.invoke_anonymous_function(col, func_name)
|
sqlframe/base/session.py
CHANGED
@@ -304,8 +304,6 @@ class _BaseSession(t.Generic[CATALOG, READER, WRITER, DF, TABLE, CONN, UDF_REGIS
|
|
304
304
|
elif isinstance(value, float):
|
305
305
|
return "double"
|
306
306
|
elif isinstance(value, datetime.datetime):
|
307
|
-
if value.tzinfo:
|
308
|
-
return "timestamptz"
|
309
307
|
return "timestamp"
|
310
308
|
elif isinstance(value, datetime.date):
|
311
309
|
return "date"
|
sqlframe/base/util.py
CHANGED
@@ -313,7 +313,7 @@ def sqlglot_to_spark(sqlglot_dtype: exp.DataType) -> types.DataType:
|
|
313
313
|
exp.DataType.Type.TIMESTAMP: types.TimestampType,
|
314
314
|
exp.DataType.Type.TIMESTAMPTZ: types.TimestampType,
|
315
315
|
exp.DataType.Type.TIMESTAMPLTZ: types.TimestampType,
|
316
|
-
exp.DataType.Type.TIMESTAMPNTZ: types.
|
316
|
+
exp.DataType.Type.TIMESTAMPNTZ: types.TimestampNTZType,
|
317
317
|
exp.DataType.Type.DATE: types.DateType,
|
318
318
|
exp.DataType.Type.JSON: types.StringType,
|
319
319
|
}
|
sqlframe/duckdb/session.py
CHANGED
@@ -41,13 +41,14 @@ class DuckDBSession(
|
|
41
41
|
|
42
42
|
def __init__(self, conn: t.Optional[DuckDBPyConnection] = None, *args, **kwargs):
|
43
43
|
import duckdb
|
44
|
+
from duckdb import InvalidInputException
|
44
45
|
from duckdb.typing import VARCHAR
|
45
46
|
|
46
47
|
if not hasattr(self, "_conn"):
|
47
48
|
conn = conn or duckdb.connect()
|
48
49
|
try:
|
49
50
|
conn.create_function("SOUNDEX", lambda x: soundex(x), return_type=VARCHAR)
|
50
|
-
except ImportError:
|
51
|
+
except (ImportError, InvalidInputException):
|
51
52
|
pass
|
52
53
|
|
53
54
|
super().__init__(conn, *args, **kwargs)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sqlframe
|
3
|
-
Version: 3.31.
|
3
|
+
Version: 3.31.4
|
4
4
|
Summary: Turning PySpark Into a Universal DataFrame API
|
5
5
|
Home-page: https://github.com/eakmanrq/sqlframe
|
6
6
|
Author: Ryan Eakman
|
@@ -17,7 +17,7 @@ Requires-Python: >=3.9
|
|
17
17
|
Description-Content-Type: text/markdown
|
18
18
|
License-File: LICENSE
|
19
19
|
Requires-Dist: prettytable <4
|
20
|
-
Requires-Dist: sqlglot <26.
|
20
|
+
Requires-Dist: sqlglot <26.18,>=24.0.0
|
21
21
|
Requires-Dist: typing-extensions
|
22
22
|
Provides-Extra: bigquery
|
23
23
|
Requires-Dist: google-cloud-bigquery-storage <3,>=2 ; extra == 'bigquery'
|
@@ -33,7 +33,7 @@ Requires-Dist: pandas-stubs <3,>=2 ; extra == 'dev'
|
|
33
33
|
Requires-Dist: pandas <3,>=2 ; extra == 'dev'
|
34
34
|
Requires-Dist: pre-commit <5,>=3.7 ; extra == 'dev'
|
35
35
|
Requires-Dist: psycopg <4,>=3.1 ; extra == 'dev'
|
36
|
-
Requires-Dist: pyarrow <
|
36
|
+
Requires-Dist: pyarrow <21,>=10 ; extra == 'dev'
|
37
37
|
Requires-Dist: pyspark <3.6,>=2 ; extra == 'dev'
|
38
38
|
Requires-Dist: pytest-forked ; extra == 'dev'
|
39
39
|
Requires-Dist: pytest-postgresql <8,>=6 ; extra == 'dev'
|
@@ -59,7 +59,7 @@ Requires-Dist: psycopg2 <3,>=2.8 ; extra == 'postgres'
|
|
59
59
|
Provides-Extra: redshift
|
60
60
|
Requires-Dist: redshift-connector <2.2.0,>=2.1.1 ; extra == 'redshift'
|
61
61
|
Provides-Extra: snowflake
|
62
|
-
Requires-Dist: snowflake-connector-python[secure-local-storage] <3.
|
62
|
+
Requires-Dist: snowflake-connector-python[secure-local-storage] <3.16,>=3.10.0 ; extra == 'snowflake'
|
63
63
|
Provides-Extra: spark
|
64
64
|
Requires-Dist: pyspark <3.6,>=2 ; extra == 'spark'
|
65
65
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
sqlframe/__init__.py,sha256=SB80yLTITBXHI2GCDS6n6bN5ObHqgPjfpRPAUwxaots,3403
|
2
|
-
sqlframe/_version.py,sha256=
|
2
|
+
sqlframe/_version.py,sha256=ChXgGAAbqvs9VsUGEq1WDjWaF9LZTEF8w01X7cgcZUs,513
|
3
3
|
sqlframe/py.typed,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
4
4
|
sqlframe/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
sqlframe/base/_typing.py,sha256=b2clI5HI1zEZKB_3Msx3FeAJQyft44ubUifJwQRVXyQ,1298
|
@@ -9,17 +9,17 @@ sqlframe/base/dataframe.py,sha256=D2N2Kvh_tiF60fYODUikq0xRCJYY4WB2aHbEcq5NIUo,84
|
|
9
9
|
sqlframe/base/decorators.py,sha256=IhE5xNQDkwJHacCvulq5WpUKyKmXm7dL2A3o5WuKGP4,2131
|
10
10
|
sqlframe/base/exceptions.py,sha256=9Uwvqn2eAkDpqm4BrRgbL61qM-GMCbJEMAW8otxO46s,370
|
11
11
|
sqlframe/base/function_alternatives.py,sha256=Bs1bwl25fN3Yy9rb4GnUWBGunQ1C_yelkb2yV9DSZIY,53918
|
12
|
-
sqlframe/base/functions.py,sha256=
|
12
|
+
sqlframe/base/functions.py,sha256=sEBPrJ8f86fjFEXohnMq7JK7Qh2-51OUIq-KFnjNCIg,227204
|
13
13
|
sqlframe/base/group.py,sha256=OY4w1WRsCqLgW-Pi7DjF63zbbxSLISCF3qjAbzI2CQ4,4283
|
14
14
|
sqlframe/base/normalize.py,sha256=nXAJ5CwxVf4DV0GsH-q1w0p8gmjSMlv96k_ez1eVul8,3880
|
15
15
|
sqlframe/base/operations.py,sha256=g-YNcbvNKTOBbYm23GKfB3fmydlR7ZZDAuZUtXIHtzw,4438
|
16
16
|
sqlframe/base/readerwriter.py,sha256=Nb2VJ_HBmLQp5mK8JhnFooZh2ydAaboCAFVPb-4MNX4,31241
|
17
|
-
sqlframe/base/session.py,sha256=
|
17
|
+
sqlframe/base/session.py,sha256=tSNlIlo7XeZUQFsZ3wnffqFLdxynY9i7oz60GUF-V14,27104
|
18
18
|
sqlframe/base/table.py,sha256=rCeh1W5SWbtEVfkLAUiexzrZwNgmZeptLEmLcM1ABkE,6961
|
19
19
|
sqlframe/base/transforms.py,sha256=y0j3SGDz3XCmNGrvassk1S-owllUWfkHyMgZlY6SFO4,467
|
20
20
|
sqlframe/base/types.py,sha256=iBNk9bpFtb2NBIogYS8i7OlQZMRvpR6XxqzBebsjQDU,12280
|
21
21
|
sqlframe/base/udf.py,sha256=O6hMhBUy9NVv-mhJRtfFhXTIa_-Z8Y_FkmmuOHu0l90,1117
|
22
|
-
sqlframe/base/util.py,sha256=
|
22
|
+
sqlframe/base/util.py,sha256=P8NcogrbNGAS69uWfsBx-50c-4QgVQxUqZC2IrWX_Ts,15522
|
23
23
|
sqlframe/base/window.py,sha256=7NaKDTlhun-95LEghukBCjFBwq0RHrPaajWQNCsLxok,4818
|
24
24
|
sqlframe/base/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
sqlframe/base/mixins/catalog_mixins.py,sha256=9fZGWToz9xMJSzUl1vsVtj6TH3TysP3fBCKJLnGUQzE,23353
|
@@ -60,7 +60,7 @@ sqlframe/duckdb/functions.py,sha256=ix2efGGD4HLaY1rtCtEd3IrsicGEVGiBAeKOo5OD8rA,
|
|
60
60
|
sqlframe/duckdb/functions.pyi,sha256=hDjpT-tGDO8LyElcno5YYRUnJg1dXXbGcRjJ69Zqk_U,12542
|
61
61
|
sqlframe/duckdb/group.py,sha256=IkhbW42Ng1U5YT3FkIdiB4zBqRkW4QyTb-1detY1e_4,383
|
62
62
|
sqlframe/duckdb/readwriter.py,sha256=WEfUSKI68BFwAt4xwQX-GO8ZSGuUQYgYKkmWE55DmJo,5171
|
63
|
-
sqlframe/duckdb/session.py,sha256=
|
63
|
+
sqlframe/duckdb/session.py,sha256=FBU78oA9Lnj5A8ikVswQEDIlJcA3wc0Thn6KVso5iqM,2793
|
64
64
|
sqlframe/duckdb/table.py,sha256=AmEKoH2TZo98loS5NbNaTuqv0eg76SY_OckVBMmQ6Co,410
|
65
65
|
sqlframe/duckdb/types.py,sha256=KwNyuXIo-2xVVd4bZED3YrQOobKCtemlxGrJL7DrTC8,34
|
66
66
|
sqlframe/duckdb/udf.py,sha256=Du9LnOtT1lJvB90D4HSR2tB7MXy179jZngDR-EjVjQk,656
|
@@ -130,8 +130,8 @@ sqlframe/standalone/udf.py,sha256=azmgtUjHNIPs0WMVNId05SHwiYn41MKVBhKXsQJ5dmY,27
|
|
130
130
|
sqlframe/standalone/window.py,sha256=6GKPzuxeSapJakBaKBeT9VpED1ACdjggDv9JRILDyV0,35
|
131
131
|
sqlframe/testing/__init__.py,sha256=VVCosQhitU74A3NnE52O4mNtGZONapuEXcc20QmSlnQ,132
|
132
132
|
sqlframe/testing/utils.py,sha256=PFsGZpwNUE_4-g_f43_vstTqsK0AQ2lBneb5Eb6NkFo,13008
|
133
|
-
sqlframe-3.31.
|
134
|
-
sqlframe-3.31.
|
135
|
-
sqlframe-3.31.
|
136
|
-
sqlframe-3.31.
|
137
|
-
sqlframe-3.31.
|
133
|
+
sqlframe-3.31.4.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
|
134
|
+
sqlframe-3.31.4.dist-info/METADATA,sha256=XPgc6hiVWeBojzJ_UD6VAHhxIQ3aFTt2U2m-vYSIvao,8987
|
135
|
+
sqlframe-3.31.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
136
|
+
sqlframe-3.31.4.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
|
137
|
+
sqlframe-3.31.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|