sqlframe 3.43.6__py3-none-any.whl → 3.43.8__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/__init__.py +4 -0
- sqlframe/_version.py +3 -3
- sqlframe/base/functions.py +18 -12
- {sqlframe-3.43.6.dist-info → sqlframe-3.43.8.dist-info}/METADATA +4 -3
- {sqlframe-3.43.6.dist-info → sqlframe-3.43.8.dist-info}/RECORD +8 -8
- {sqlframe-3.43.6.dist-info → sqlframe-3.43.8.dist-info}/LICENSE +0 -0
- {sqlframe-3.43.6.dist-info → sqlframe-3.43.8.dist-info}/WHEEL +0 -0
- {sqlframe-3.43.6.dist-info → sqlframe-3.43.8.dist-info}/top_level.txt +0 -0
sqlframe/__init__.py
CHANGED
|
@@ -6,6 +6,10 @@ import typing as t
|
|
|
6
6
|
from contextlib import contextmanager
|
|
7
7
|
from unittest.mock import MagicMock
|
|
8
8
|
|
|
9
|
+
from sqlglot.dialects import spark
|
|
10
|
+
|
|
11
|
+
spark.Spark.Generator.readparquet_sql = lambda self, x: x.sql(dialect="duckdb") # type: ignore
|
|
12
|
+
|
|
9
13
|
if t.TYPE_CHECKING:
|
|
10
14
|
from sqlframe.base.session import CONN
|
|
11
15
|
|
sqlframe/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '3.43.
|
|
32
|
-
__version_tuple__ = version_tuple = (3, 43,
|
|
31
|
+
__version__ = version = '3.43.8'
|
|
32
|
+
__version_tuple__ = version_tuple = (3, 43, 8)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g371f414f3'
|
sqlframe/base/functions.py
CHANGED
|
@@ -60,7 +60,11 @@ def lit(value: t.Optional[t.Any] = None) -> Column:
|
|
|
60
60
|
if isinstance(value, str):
|
|
61
61
|
return Column(expression.Literal.string(value))
|
|
62
62
|
if isinstance(value, float) and value in {float("inf"), float("-inf")}:
|
|
63
|
-
return Column(
|
|
63
|
+
return Column(
|
|
64
|
+
expression.cast(
|
|
65
|
+
expression.Literal.string(str(value)), to=expression.DataType.Type.FLOAT
|
|
66
|
+
)
|
|
67
|
+
)
|
|
64
68
|
return Column(value)
|
|
65
69
|
|
|
66
70
|
|
|
@@ -414,7 +418,7 @@ def radians(col: ColumnOrName) -> Column:
|
|
|
414
418
|
if session._is_bigquery:
|
|
415
419
|
return radians_bgutil(col)
|
|
416
420
|
|
|
417
|
-
return Column.
|
|
421
|
+
return Column.invoke_expression_over_column(col, expression.Radians)
|
|
418
422
|
|
|
419
423
|
|
|
420
424
|
toRadians = radians
|
|
@@ -1078,7 +1082,7 @@ def hour(col: ColumnOrName) -> Column:
|
|
|
1078
1082
|
if session._is_bigquery or session._is_postgres:
|
|
1079
1083
|
return hour_from_extract(col)
|
|
1080
1084
|
|
|
1081
|
-
return Column.
|
|
1085
|
+
return Column.invoke_expression_over_column(col, expression.Hour)
|
|
1082
1086
|
|
|
1083
1087
|
|
|
1084
1088
|
@meta()
|
|
@@ -1090,7 +1094,7 @@ def minute(col: ColumnOrName) -> Column:
|
|
|
1090
1094
|
if session._is_bigquery or session._is_postgres:
|
|
1091
1095
|
return minute_from_extract(col)
|
|
1092
1096
|
|
|
1093
|
-
return Column.
|
|
1097
|
+
return Column.invoke_expression_over_column(col, expression.Minute)
|
|
1094
1098
|
|
|
1095
1099
|
|
|
1096
1100
|
@meta()
|
|
@@ -1102,7 +1106,7 @@ def second(col: ColumnOrName) -> Column:
|
|
|
1102
1106
|
if session._is_bigquery or session._is_postgres:
|
|
1103
1107
|
return second_from_extract(col)
|
|
1104
1108
|
|
|
1105
|
-
return Column.
|
|
1109
|
+
return Column.invoke_expression_over_column(col, expression.Second)
|
|
1106
1110
|
|
|
1107
1111
|
|
|
1108
1112
|
@meta()
|
|
@@ -1398,7 +1402,7 @@ def next_day(col: ColumnOrName, dayOfWeek: str) -> Column:
|
|
|
1398
1402
|
if session._is_bigquery:
|
|
1399
1403
|
return next_day_bgutil(col, dayOfWeek)
|
|
1400
1404
|
|
|
1401
|
-
return Column.
|
|
1405
|
+
return Column.invoke_expression_over_column(col, expression.NextDay, expression=lit(dayOfWeek))
|
|
1402
1406
|
|
|
1403
1407
|
|
|
1404
1408
|
@meta()
|
|
@@ -2160,7 +2164,7 @@ def bit_count(col: ColumnOrName) -> Column:
|
|
|
2160
2164
|
if session._is_duckdb:
|
|
2161
2165
|
return Column.invoke_anonymous_function(col, "BIT_COUNT")
|
|
2162
2166
|
|
|
2163
|
-
return Column.invoke_expression_over_column(col, expression.
|
|
2167
|
+
return Column.invoke_expression_over_column(col, expression.BitwiseCount)
|
|
2164
2168
|
|
|
2165
2169
|
|
|
2166
2170
|
@meta(unsupported_engines="*")
|
|
@@ -3308,9 +3312,9 @@ def endswith(str: ColumnOrName, suffix: ColumnOrName) -> Column:
|
|
|
3308
3312
|
)
|
|
3309
3313
|
|
|
3310
3314
|
|
|
3311
|
-
@meta(unsupported_engines="
|
|
3315
|
+
@meta(unsupported_engines=["bigquery", "duckdb", "postgres"])
|
|
3312
3316
|
def equal_null(col1: ColumnOrName, col2: ColumnOrName) -> Column:
|
|
3313
|
-
return Column.
|
|
3317
|
+
return Column.invoke_expression_over_column(col1, expression.EqualNull, expression=col2)
|
|
3314
3318
|
|
|
3315
3319
|
|
|
3316
3320
|
@meta(unsupported_engines="*")
|
|
@@ -4108,7 +4112,7 @@ def left(str: ColumnOrName, len: ColumnOrName) -> Column:
|
|
|
4108
4112
|
return Column.invoke_expression_over_column(str, expression.Left, expression=len)
|
|
4109
4113
|
|
|
4110
4114
|
|
|
4111
|
-
@meta(unsupported_engines="
|
|
4115
|
+
@meta(unsupported_engines="bigquery")
|
|
4112
4116
|
def like(
|
|
4113
4117
|
str: ColumnOrName, pattern: ColumnOrName, escapeChar: t.Optional["Column"] = None
|
|
4114
4118
|
) -> Column:
|
|
@@ -6805,7 +6809,7 @@ def weekday(col: ColumnOrName) -> Column:
|
|
|
6805
6809
|
return Column.invoke_anonymous_function(col, "weekday")
|
|
6806
6810
|
|
|
6807
6811
|
|
|
6808
|
-
@meta(unsupported_engines="
|
|
6812
|
+
@meta(unsupported_engines=["bigquery", "duckdb", "postgres"])
|
|
6809
6813
|
def width_bucket(
|
|
6810
6814
|
v: ColumnOrName,
|
|
6811
6815
|
min: ColumnOrName,
|
|
@@ -6854,7 +6858,9 @@ def width_bucket(
|
|
|
6854
6858
|
+----------------------------+
|
|
6855
6859
|
"""
|
|
6856
6860
|
numBucket = lit(numBucket) if isinstance(numBucket, int) else numBucket
|
|
6857
|
-
return Column.
|
|
6861
|
+
return Column.invoke_expression_over_column(
|
|
6862
|
+
v, expression.WidthBucket, min_value=min, max_value=max, num_buckets=numBucket
|
|
6863
|
+
)
|
|
6858
6864
|
|
|
6859
6865
|
|
|
6860
6866
|
@meta(unsupported_engines=["*", "spark"])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sqlframe
|
|
3
|
-
Version: 3.43.
|
|
3
|
+
Version: 3.43.8
|
|
4
4
|
Summary: Turning PySpark Into a Universal DataFrame API
|
|
5
5
|
Home-page: https://github.com/eakmanrq/sqlframe
|
|
6
6
|
Author: Ryan Eakman
|
|
@@ -18,7 +18,7 @@ Description-Content-Type: text/markdown
|
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: more-itertools
|
|
20
20
|
Requires-Dist: prettytable <4
|
|
21
|
-
Requires-Dist: sqlglot <27.
|
|
21
|
+
Requires-Dist: sqlglot <27.30,>=24.0.0
|
|
22
22
|
Requires-Dist: typing-extensions
|
|
23
23
|
Provides-Extra: bigquery
|
|
24
24
|
Requires-Dist: google-cloud-bigquery-storage <3,>=2 ; extra == 'bigquery'
|
|
@@ -28,13 +28,14 @@ Requires-Dist: databricks-sql-connector[pyarrow] <5,>=3.6 ; extra == 'databricks
|
|
|
28
28
|
Provides-Extra: dev
|
|
29
29
|
Requires-Dist: duckdb <1.5,>=1.2 ; extra == 'dev'
|
|
30
30
|
Requires-Dist: findspark <3,>=2 ; extra == 'dev'
|
|
31
|
+
Requires-Dist: mirakuru <3.0.0 ; extra == 'dev'
|
|
31
32
|
Requires-Dist: mypy <1.19,>=1.10.0 ; extra == 'dev'
|
|
32
33
|
Requires-Dist: openai <3,>=1.30 ; extra == 'dev'
|
|
33
34
|
Requires-Dist: pandas-stubs <3,>=2 ; extra == 'dev'
|
|
34
35
|
Requires-Dist: pandas <3,>=2 ; extra == 'dev'
|
|
35
36
|
Requires-Dist: pre-commit <5,>=3.7 ; extra == 'dev'
|
|
36
37
|
Requires-Dist: psycopg <4,>=3.1 ; extra == 'dev'
|
|
37
|
-
Requires-Dist: pyarrow <
|
|
38
|
+
Requires-Dist: pyarrow <23,>=10 ; extra == 'dev'
|
|
38
39
|
Requires-Dist: pyspark <3.6,>=2 ; extra == 'dev'
|
|
39
40
|
Requires-Dist: pytest-forked ; extra == 'dev'
|
|
40
41
|
Requires-Dist: pytest-postgresql <8,>=6 ; extra == 'dev'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
sqlframe/__init__.py,sha256=
|
|
2
|
-
sqlframe/_version.py,sha256=
|
|
1
|
+
sqlframe/__init__.py,sha256=Et338oqN6tgrUNzSHpaIyjTiXcXS9lze7qeLFYdRNVc,3536
|
|
2
|
+
sqlframe/_version.py,sha256=h6y12CzI4Xz_j0jGD8riwX7mlvg7zIGwFg0P-8kKcC4,714
|
|
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,7 +9,7 @@ sqlframe/base/dataframe.py,sha256=iKdiJ9OnMEbL0GAwydP9hQz0XsTKs1mpKi_6ajrCZ9I,90
|
|
|
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=aTu3nQhIAkZoxrI1IpjpaHEAMxBNms0AnhS0EMR-TwY,51727
|
|
12
|
-
sqlframe/base/functions.py,sha256=
|
|
12
|
+
sqlframe/base/functions.py,sha256=bp2Mt1ajgv0JOEYfy9AVNcGO9NVLrVnrRDTjYWTgJrM,229966
|
|
13
13
|
sqlframe/base/group.py,sha256=fBm8EUve7W7xz11nybTXr09ih-yZxL_vvEiZVE1eb_0,12025
|
|
14
14
|
sqlframe/base/normalize.py,sha256=YPeopWr8ZRjevArYfrM-DZBkQp4t4UfAEwynoj4VvcU,11773
|
|
15
15
|
sqlframe/base/operations.py,sha256=v8BA80eDKBOOpfHB_Zxsdi2RrDkSl1-_gtA-GuwO8qY,4438
|
|
@@ -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.43.
|
|
134
|
-
sqlframe-3.43.
|
|
135
|
-
sqlframe-3.43.
|
|
136
|
-
sqlframe-3.43.
|
|
137
|
-
sqlframe-3.43.
|
|
133
|
+
sqlframe-3.43.8.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
|
|
134
|
+
sqlframe-3.43.8.dist-info/METADATA,sha256=WsHDXv-x51IagBt9ALqEfYrTpg5Q47znIc3lM0DIUTk,9118
|
|
135
|
+
sqlframe-3.43.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
136
|
+
sqlframe-3.43.8.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
|
|
137
|
+
sqlframe-3.43.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|