sqlframe 1.8.0__py3-none-any.whl → 1.9.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 +1 -1
- sqlframe/base/functions.py +42 -7
- sqlframe/spark/functions.pyi +3 -0
- {sqlframe-1.8.0.dist-info → sqlframe-1.9.0.dist-info}/METADATA +5 -5
- {sqlframe-1.8.0.dist-info → sqlframe-1.9.0.dist-info}/RECORD +9 -9
- {sqlframe-1.8.0.dist-info → sqlframe-1.9.0.dist-info}/LICENSE +0 -0
- {sqlframe-1.8.0.dist-info → sqlframe-1.9.0.dist-info}/WHEEL +0 -0
- {sqlframe-1.8.0.dist-info → sqlframe-1.9.0.dist-info}/top_level.txt +0 -0
sqlframe/_version.py
CHANGED
sqlframe/base/column.py
CHANGED
|
@@ -229,7 +229,7 @@ class Column:
|
|
|
229
229
|
return Column(op)
|
|
230
230
|
|
|
231
231
|
def unary_op(self, klass: t.Callable, **kwargs) -> Column:
|
|
232
|
-
return Column(klass(this=self.column_expression, **kwargs))
|
|
232
|
+
return Column(klass(this=exp.Paren(this=self.column_expression), **kwargs))
|
|
233
233
|
|
|
234
234
|
@property
|
|
235
235
|
def is_alias(self):
|
sqlframe/base/functions.py
CHANGED
|
@@ -1692,14 +1692,9 @@ def make_interval(
|
|
|
1692
1692
|
mins: t.Optional[ColumnOrName] = None,
|
|
1693
1693
|
secs: t.Optional[ColumnOrName] = None,
|
|
1694
1694
|
) -> Column:
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
if value is not None:
|
|
1698
|
-
break
|
|
1699
|
-
values = values[:-1]
|
|
1700
|
-
else:
|
|
1695
|
+
columns = _ensure_column_of_optionals([years, months, weeks, days, hours, mins, secs])
|
|
1696
|
+
if not columns:
|
|
1701
1697
|
raise ValueError("At least one value must be provided")
|
|
1702
|
-
columns = [Column.ensure_col(x) if x is not None else lit(None) for x in values]
|
|
1703
1698
|
return Column.invoke_anonymous_function(columns[0], "MAKE_INTERVAL", *columns[1:])
|
|
1704
1699
|
|
|
1705
1700
|
|
|
@@ -1747,6 +1742,38 @@ def try_to_number(col: ColumnOrName, format: t.Optional[ColumnOrName] = None) ->
|
|
|
1747
1742
|
return Column.invoke_anonymous_function(col, "TRY_TO_NUMBER")
|
|
1748
1743
|
|
|
1749
1744
|
|
|
1745
|
+
@meta(unsupported_engines="*")
|
|
1746
|
+
def aes_decrypt(
|
|
1747
|
+
input: ColumnOrName,
|
|
1748
|
+
key: ColumnOrName,
|
|
1749
|
+
mode: t.Optional[ColumnOrName] = None,
|
|
1750
|
+
padding: t.Optional[ColumnOrName] = None,
|
|
1751
|
+
aad: t.Optional[ColumnOrName] = None,
|
|
1752
|
+
) -> Column:
|
|
1753
|
+
columns = _ensure_column_of_optionals([key, mode, padding, aad])
|
|
1754
|
+
return Column.invoke_anonymous_function(input, "AES_DECRYPT", *columns)
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
@meta(unsupported_engines="*")
|
|
1758
|
+
def aes_encrypt(
|
|
1759
|
+
input: ColumnOrName,
|
|
1760
|
+
key: ColumnOrName,
|
|
1761
|
+
mode: t.Optional[ColumnOrName] = None,
|
|
1762
|
+
padding: t.Optional[ColumnOrName] = None,
|
|
1763
|
+
iv: t.Optional[ColumnOrName] = None,
|
|
1764
|
+
aad: t.Optional[ColumnOrName] = None,
|
|
1765
|
+
) -> Column:
|
|
1766
|
+
columns = _ensure_column_of_optionals([key, mode, padding, iv, aad])
|
|
1767
|
+
return Column.invoke_anonymous_function(input, "AES_ENCRYPT", *columns)
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
@meta(unsupported_engines="*")
|
|
1771
|
+
def to_binary(col: ColumnOrName, format: t.Optional[ColumnOrName] = None) -> Column:
|
|
1772
|
+
if format is not None:
|
|
1773
|
+
return Column.invoke_anonymous_function(col, "TO_BINARY", format)
|
|
1774
|
+
return Column.invoke_anonymous_function(col, "TO_BINARY")
|
|
1775
|
+
|
|
1776
|
+
|
|
1750
1777
|
@meta()
|
|
1751
1778
|
def _lambda_quoted(value: str) -> t.Optional[bool]:
|
|
1752
1779
|
return False if value == "_" else None
|
|
@@ -1762,3 +1789,11 @@ def _get_lambda_from_func(lambda_expression: t.Callable):
|
|
|
1762
1789
|
this=lambda_expression(*[Column(x) for x in variables]).expression,
|
|
1763
1790
|
expressions=variables,
|
|
1764
1791
|
)
|
|
1792
|
+
|
|
1793
|
+
|
|
1794
|
+
def _ensure_column_of_optionals(optionals: t.List[t.Optional[ColumnOrName]]) -> t.List[Column]:
|
|
1795
|
+
for value in reversed(optionals.copy()):
|
|
1796
|
+
if value is not None:
|
|
1797
|
+
break
|
|
1798
|
+
optionals = optionals[:-1]
|
|
1799
|
+
return [Column.ensure_col(x) if x is not None else lit(None) for x in optionals]
|
sqlframe/spark/functions.pyi
CHANGED
|
@@ -7,6 +7,8 @@ from sqlframe.base.functions import (
|
|
|
7
7
|
abs as abs,
|
|
8
8
|
acos as acos,
|
|
9
9
|
acosh as acosh,
|
|
10
|
+
aes_encrypt as aes_encrypt,
|
|
11
|
+
aes_decrypt as aes_decrypt,
|
|
10
12
|
aggregate as aggregate,
|
|
11
13
|
approxCountDistinct as approxCountDistinct,
|
|
12
14
|
approx_count_distinct as approx_count_distinct,
|
|
@@ -218,6 +220,7 @@ from sqlframe.base.functions import (
|
|
|
218
220
|
timestamp_seconds as timestamp_seconds,
|
|
219
221
|
toDegrees as toDegrees,
|
|
220
222
|
toRadians as toRadians,
|
|
223
|
+
to_binary as to_binary,
|
|
221
224
|
to_csv as to_csv,
|
|
222
225
|
to_date as to_date,
|
|
223
226
|
to_json as to_json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sqlframe
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.0
|
|
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 @@ Requires-Python: >=3.8
|
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: prettytable (<3.11.0)
|
|
21
|
-
Requires-Dist: sqlglot (<25.
|
|
21
|
+
Requires-Dist: sqlglot (<25.4,>=24.0.0)
|
|
22
22
|
Requires-Dist: typing-extensions (<5,>=4.8)
|
|
23
23
|
Provides-Extra: bigquery
|
|
24
24
|
Requires-Dist: google-cloud-bigquery-storage (<3,>=2) ; extra == 'bigquery'
|
|
@@ -26,7 +26,7 @@ Requires-Dist: google-cloud-bigquery[pandas] (<4,>=3) ; extra == 'bigquery'
|
|
|
26
26
|
Provides-Extra: dev
|
|
27
27
|
Requires-Dist: duckdb (<1.1,>=0.9) ; extra == 'dev'
|
|
28
28
|
Requires-Dist: mypy (<1.11,>=1.10.0) ; extra == 'dev'
|
|
29
|
-
Requires-Dist: openai (<1.
|
|
29
|
+
Requires-Dist: openai (<1.36,>=1.30) ; extra == 'dev'
|
|
30
30
|
Requires-Dist: pandas-stubs (<3,>=2) ; extra == 'dev'
|
|
31
31
|
Requires-Dist: pandas (<3,>=2) ; extra == 'dev'
|
|
32
32
|
Requires-Dist: psycopg (<4,>=3.1) ; extra == 'dev'
|
|
@@ -49,7 +49,7 @@ Provides-Extra: duckdb
|
|
|
49
49
|
Requires-Dist: duckdb (<1.1,>=0.9) ; extra == 'duckdb'
|
|
50
50
|
Requires-Dist: pandas (<3,>=2) ; extra == 'duckdb'
|
|
51
51
|
Provides-Extra: openai
|
|
52
|
-
Requires-Dist: openai (<1.
|
|
52
|
+
Requires-Dist: openai (<1.36,>=1.30) ; extra == 'openai'
|
|
53
53
|
Provides-Extra: pandas
|
|
54
54
|
Requires-Dist: pandas (<3,>=2) ; extra == 'pandas'
|
|
55
55
|
Provides-Extra: postgres
|
|
@@ -57,7 +57,7 @@ Requires-Dist: psycopg2 (<3,>=2.8) ; extra == 'postgres'
|
|
|
57
57
|
Provides-Extra: redshift
|
|
58
58
|
Requires-Dist: redshift-connector (<2.2.0,>=2.1.1) ; extra == 'redshift'
|
|
59
59
|
Provides-Extra: snowflake
|
|
60
|
-
Requires-Dist: snowflake-connector-python[secure-local-storage] (<3.
|
|
60
|
+
Requires-Dist: snowflake-connector-python[secure-local-storage] (<3.12,>=3.10.0) ; extra == 'snowflake'
|
|
61
61
|
Provides-Extra: spark
|
|
62
62
|
Requires-Dist: pyspark (<3.6,>=2) ; extra == 'spark'
|
|
63
63
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
sqlframe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
sqlframe/_version.py,sha256=
|
|
2
|
+
sqlframe/_version.py,sha256=Wi1Vgg8ccNVK7oIZNO8kmGhwjztIUyuzlku2tkT7820,411
|
|
3
3
|
sqlframe/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
sqlframe/base/_typing.py,sha256=DuTay8-o9W-pw3RPZCgLunKNJLS9PkaV11G_pxXp9NY,1256
|
|
5
5
|
sqlframe/base/catalog.py,sha256=ATDGirouUjal05P4ymL-wIi8rgjg_8w4PoACamiO64A,37245
|
|
6
|
-
sqlframe/base/column.py,sha256=
|
|
6
|
+
sqlframe/base/column.py,sha256=5bfJWj9dnStHUxLSrWMD-gwiC4-aHKC8lhoC62nhM1k,16153
|
|
7
7
|
sqlframe/base/dataframe.py,sha256=uL4neDTMy1a9XJH46YLQryzdDci4iDxNXBtiJOzfHfs,67718
|
|
8
8
|
sqlframe/base/decorators.py,sha256=I5osMgx9BuCgbtp4jVM2DNwYJVLzCv-OtTedhQEik0g,1882
|
|
9
9
|
sqlframe/base/exceptions.py,sha256=pCB9hXX4jxZWzNg3JN1i38cv3BmpUlee5NoLYx3YXIQ,208
|
|
10
10
|
sqlframe/base/function_alternatives.py,sha256=NDXs2igY7PBsStzTSRZvJcCshBOJkPQl2GbhpVFU6To,42931
|
|
11
|
-
sqlframe/base/functions.py,sha256=
|
|
11
|
+
sqlframe/base/functions.py,sha256=FZczLQzADcXQWuKUbv67LHnK1yQU4nVzJGnNJQEHkrY,58438
|
|
12
12
|
sqlframe/base/group.py,sha256=TES9CleVmH3x-0X-tqmuUKfCKSWjH5vg1aU3R6dDmFc,4059
|
|
13
13
|
sqlframe/base/normalize.py,sha256=nXAJ5CwxVf4DV0GsH-q1w0p8gmjSMlv96k_ez1eVul8,3880
|
|
14
14
|
sqlframe/base/operations.py,sha256=-AhNuEzcV7ZExoP1oY3blaKip-joQyJeQVvfBTs_2g4,3456
|
|
@@ -81,7 +81,7 @@ sqlframe/spark/catalog.py,sha256=rIX5DtPnINbcPZRUe4Z1bOpkJoNRlrO9qWkUeTQClNc,326
|
|
|
81
81
|
sqlframe/spark/column.py,sha256=E1tUa62Y5HajkhgFuebU9zohrGyieudcHzTT8gfalio,40
|
|
82
82
|
sqlframe/spark/dataframe.py,sha256=V3z5Bx9snLgYh4bDwJfJb5mj1P7UsZF8DMlLwZXopBg,1309
|
|
83
83
|
sqlframe/spark/functions.py,sha256=PkK4MBpVADhnDbrgFDii5zFaNrhi4y-OYX3Lcu-SW0k,530
|
|
84
|
-
sqlframe/spark/functions.pyi,sha256=
|
|
84
|
+
sqlframe/spark/functions.pyi,sha256=0gyD8H7qYqiG-u_dpZB9wBuPni6GB5wa8YXUICoZMwU,6849
|
|
85
85
|
sqlframe/spark/group.py,sha256=MrvV_v-YkBc6T1zz882WrEqtWjlooWIyHBCmTQg3fCA,379
|
|
86
86
|
sqlframe/spark/readwriter.py,sha256=w68EImTcGJv64X7pc1tk5tDjDxb1nAnn-MiIaaN9Dc8,812
|
|
87
87
|
sqlframe/spark/session.py,sha256=ztIS7VCFxjR3B7i4JXaXo0evTUhUjOsIAZb7Ssqt2cU,4254
|
|
@@ -97,8 +97,8 @@ sqlframe/standalone/readwriter.py,sha256=EZNyDJ4ID6sGNog3uP4-e9RvchX4biJJDNtc5hk
|
|
|
97
97
|
sqlframe/standalone/session.py,sha256=wQmdu2sv6KMTAv0LRFk7TY7yzlh3xvmsyqilEtRecbY,1191
|
|
98
98
|
sqlframe/standalone/types.py,sha256=KwNyuXIo-2xVVd4bZED3YrQOobKCtemlxGrJL7DrTC8,34
|
|
99
99
|
sqlframe/standalone/window.py,sha256=6GKPzuxeSapJakBaKBeT9VpED1ACdjggDv9JRILDyV0,35
|
|
100
|
-
sqlframe-1.
|
|
101
|
-
sqlframe-1.
|
|
102
|
-
sqlframe-1.
|
|
103
|
-
sqlframe-1.
|
|
104
|
-
sqlframe-1.
|
|
100
|
+
sqlframe-1.9.0.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
|
|
101
|
+
sqlframe-1.9.0.dist-info/METADATA,sha256=ZqMpC8SchKLMSu0-H36KkmMLQcv13IKaK-AKumtcIYA,7496
|
|
102
|
+
sqlframe-1.9.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
103
|
+
sqlframe-1.9.0.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
|
|
104
|
+
sqlframe-1.9.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|