sqlframe 2.2.0__py3-none-any.whl → 2.4.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 +3 -1
- sqlframe/base/function_alternatives.py +24 -1
- sqlframe/duckdb/functions.py +1 -0
- sqlframe/duckdb/functions.pyi +1 -1
- sqlframe/postgres/functions.py +1 -0
- sqlframe/postgres/functions.pyi +1 -1
- {sqlframe-2.2.0.dist-info → sqlframe-2.4.0.dist-info}/METADATA +6 -6
- {sqlframe-2.2.0.dist-info → sqlframe-2.4.0.dist-info}/RECORD +12 -12
- {sqlframe-2.2.0.dist-info → sqlframe-2.4.0.dist-info}/LICENSE +0 -0
- {sqlframe-2.2.0.dist-info → sqlframe-2.4.0.dist-info}/WHEEL +0 -0
- {sqlframe-2.2.0.dist-info → sqlframe-2.4.0.dist-info}/top_level.txt +0 -0
sqlframe/_version.py
CHANGED
sqlframe/base/column.py
CHANGED
|
@@ -339,7 +339,9 @@ class Column:
|
|
|
339
339
|
return Column(new_expression)
|
|
340
340
|
|
|
341
341
|
def cast(
|
|
342
|
-
self,
|
|
342
|
+
self,
|
|
343
|
+
dataType: t.Union[str, DataType, exp.DataType, exp.DataType.Type],
|
|
344
|
+
dialect: t.Optional[t.Union[str, Dialect]] = None,
|
|
343
345
|
) -> Column:
|
|
344
346
|
from sqlframe.base.session import _BaseSession
|
|
345
347
|
|
|
@@ -1593,7 +1593,7 @@ def try_to_timestamp_pgtemp(col: ColumnOrName, format: t.Optional[ColumnOrName]
|
|
|
1593
1593
|
def typeof_pg_typeof(col: ColumnOrName) -> Column:
|
|
1594
1594
|
return (
|
|
1595
1595
|
Column.invoke_anonymous_function(col, "pg_typeof")
|
|
1596
|
-
.cast("regtype", dialect="postgres")
|
|
1596
|
+
.cast(expression.DataType.build("regtype", dialect="postgres"))
|
|
1597
1597
|
.cast("text")
|
|
1598
1598
|
)
|
|
1599
1599
|
|
|
@@ -1603,6 +1603,29 @@ def typeof_from_variant(col: ColumnOrName) -> Column:
|
|
|
1603
1603
|
return Column.invoke_anonymous_function(col, "TYPEOF")
|
|
1604
1604
|
|
|
1605
1605
|
|
|
1606
|
+
def regexp_replace_global_option(
|
|
1607
|
+
str: ColumnOrName, pattern: str, replacement: str, position: t.Optional[int] = None
|
|
1608
|
+
) -> Column:
|
|
1609
|
+
lit = get_func_from_session("lit")
|
|
1610
|
+
|
|
1611
|
+
if position is not None:
|
|
1612
|
+
return Column.invoke_expression_over_column(
|
|
1613
|
+
str,
|
|
1614
|
+
expression.RegexpReplace,
|
|
1615
|
+
expression=lit(pattern),
|
|
1616
|
+
replacement=lit(replacement),
|
|
1617
|
+
position=lit(position),
|
|
1618
|
+
modifiers=lit("g"),
|
|
1619
|
+
)
|
|
1620
|
+
return Column.invoke_expression_over_column(
|
|
1621
|
+
str,
|
|
1622
|
+
expression.RegexpReplace,
|
|
1623
|
+
expression=lit(pattern),
|
|
1624
|
+
replacement=lit(replacement),
|
|
1625
|
+
modifiers=lit("g"),
|
|
1626
|
+
)
|
|
1627
|
+
|
|
1628
|
+
|
|
1606
1629
|
def _is_string_using_typeof_varchar(col: ColumnOrName) -> Column:
|
|
1607
1630
|
typeof = get_func_from_session("typeof")
|
|
1608
1631
|
lit = get_func_from_session("lit")
|
sqlframe/duckdb/functions.py
CHANGED
sqlframe/duckdb/functions.pyi
CHANGED
|
@@ -28,6 +28,7 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
28
28
|
sequence_from_generate_series as sequence,
|
|
29
29
|
try_element_at_zero_based as try_element_at,
|
|
30
30
|
to_unix_timestamp_include_default_format as to_unix_timestamp,
|
|
31
|
+
regexp_replace_global_option as regexp_replace,
|
|
31
32
|
)
|
|
32
33
|
from sqlframe.base.functions import (
|
|
33
34
|
abs as abs,
|
|
@@ -156,7 +157,6 @@ from sqlframe.base.functions import (
|
|
|
156
157
|
rank as rank,
|
|
157
158
|
regexp_extract as regexp_extract,
|
|
158
159
|
regexp_like as regexp_like,
|
|
159
|
-
regexp_replace as regexp_replace,
|
|
160
160
|
repeat as repeat,
|
|
161
161
|
reverse as reverse,
|
|
162
162
|
right as right,
|
sqlframe/postgres/functions.py
CHANGED
sqlframe/postgres/functions.pyi
CHANGED
|
@@ -47,6 +47,7 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
47
47
|
right_cast_len as right,
|
|
48
48
|
position_cast_start as position,
|
|
49
49
|
try_element_at_zero_based as try_element_at,
|
|
50
|
+
regexp_replace_global_option as regexp_replace,
|
|
50
51
|
)
|
|
51
52
|
from sqlframe.base.functions import (
|
|
52
53
|
abs as abs,
|
|
@@ -148,7 +149,6 @@ from sqlframe.base.functions import (
|
|
|
148
149
|
radians as radians,
|
|
149
150
|
rank as rank,
|
|
150
151
|
regexp_like as regexp_like,
|
|
151
|
-
regexp_replace as regexp_replace,
|
|
152
152
|
repeat as repeat,
|
|
153
153
|
reverse as reverse,
|
|
154
154
|
rlike as rlike,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sqlframe
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.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
|
|
@@ -17,8 +17,8 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
17
17
|
Requires-Python: >=3.8
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: prettytable (<3.11.
|
|
21
|
-
Requires-Dist: sqlglot (<25.
|
|
20
|
+
Requires-Dist: prettytable (<3.11.1)
|
|
21
|
+
Requires-Dist: sqlglot (<25.17,>=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.12,>=1.10.0) ; extra == 'dev'
|
|
29
|
-
Requires-Dist: openai (<1.
|
|
29
|
+
Requires-Dist: openai (<1.43,>=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'
|
|
@@ -35,7 +35,7 @@ Requires-Dist: pyspark (<3.6,>=2) ; extra == 'dev'
|
|
|
35
35
|
Requires-Dist: pytest-postgresql (<7,>=6) ; extra == 'dev'
|
|
36
36
|
Requires-Dist: pytest-xdist (<3.7,>=3.6) ; extra == 'dev'
|
|
37
37
|
Requires-Dist: pytest (<8.4,>=8.2.0) ; extra == 'dev'
|
|
38
|
-
Requires-Dist: ruff (<0.
|
|
38
|
+
Requires-Dist: ruff (<0.7,>=0.4.4) ; extra == 'dev'
|
|
39
39
|
Requires-Dist: types-psycopg2 (<3,>=2.9) ; extra == 'dev'
|
|
40
40
|
Requires-Dist: pre-commit (>=3.5) ; (python_version == "3.8") and extra == 'dev'
|
|
41
41
|
Requires-Dist: pre-commit (<3.9,>=3.7) ; (python_version >= "3.9") and 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.43,>=1.30) ; extra == 'openai'
|
|
53
53
|
Provides-Extra: pandas
|
|
54
54
|
Requires-Dist: pandas (<3,>=2) ; extra == 'pandas'
|
|
55
55
|
Provides-Extra: postgres
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
sqlframe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
sqlframe/_version.py,sha256=
|
|
2
|
+
sqlframe/_version.py,sha256=NXpAHvzuYHxlLDJV0489874frLu4dA2joFw1iHLLrOg,411
|
|
3
3
|
sqlframe/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
sqlframe/base/_typing.py,sha256=b2clI5HI1zEZKB_3Msx3FeAJQyft44ubUifJwQRVXyQ,1298
|
|
5
5
|
sqlframe/base/catalog.py,sha256=SzFQalTWdhWzxUY-4ut1f9TfOECp_JmJEgNPfrRKCe0,38457
|
|
6
|
-
sqlframe/base/column.py,sha256=
|
|
6
|
+
sqlframe/base/column.py,sha256=C2xj6OHMsJbEgjbI-m5HuIvqHYt2DbbUtCjssKpplNk,17748
|
|
7
7
|
sqlframe/base/dataframe.py,sha256=CHoSK7g9ceuX_4c8yL3nbq1nb15dGt2g_W0UBlBA-Nc,71132
|
|
8
8
|
sqlframe/base/decorators.py,sha256=Jy4bf8MhZ-AJ6CWTj59bBJRqamtLbPC0USUMFrY6g0w,449
|
|
9
9
|
sqlframe/base/exceptions.py,sha256=9Uwvqn2eAkDpqm4BrRgbL61qM-GMCbJEMAW8otxO46s,370
|
|
10
|
-
sqlframe/base/function_alternatives.py,sha256=
|
|
10
|
+
sqlframe/base/function_alternatives.py,sha256=IxNBqplehkAEkpzA625Dif-9Xyi4Hrho81A9U262rV0,50714
|
|
11
11
|
sqlframe/base/functions.py,sha256=2dDfPepAuQvLcxwaZbj9qJeEeiqOaYJDI3vPoZXoM1Q,189959
|
|
12
12
|
sqlframe/base/group.py,sha256=TES9CleVmH3x-0X-tqmuUKfCKSWjH5vg1aU3R6dDmFc,4059
|
|
13
13
|
sqlframe/base/normalize.py,sha256=nXAJ5CwxVf4DV0GsH-q1w0p8gmjSMlv96k_ez1eVul8,3880
|
|
@@ -39,8 +39,8 @@ sqlframe/duckdb/__init__.py,sha256=t85TA3ufZtL1weQNFmEs8itCSwbJFtw03-p0GT4XGf8,6
|
|
|
39
39
|
sqlframe/duckdb/catalog.py,sha256=YYYVmetLUaJOdObKw4AJ7L0P-msshkta4xHlcZQ9zEA,4795
|
|
40
40
|
sqlframe/duckdb/column.py,sha256=wkEPcp3xVsH5nC3kpacXqNkRv9htPtBgt-0uFRxIRNs,56
|
|
41
41
|
sqlframe/duckdb/dataframe.py,sha256=QYFFj6a2uYpJUGB-s0MEX2z7HgjfPbL6ZKI4BFjVI6o,1394
|
|
42
|
-
sqlframe/duckdb/functions.py,sha256=
|
|
43
|
-
sqlframe/duckdb/functions.pyi,sha256=
|
|
42
|
+
sqlframe/duckdb/functions.py,sha256=Ee8o6YFtRdEiq0jNLXxgu5lcbc7Tsg0-lK6oRyxdcjo,1920
|
|
43
|
+
sqlframe/duckdb/functions.pyi,sha256=Qn6j4zwwuBsh6q9341dR3Z5kpeRsgvM4u6Bb6FekKrI,5827
|
|
44
44
|
sqlframe/duckdb/group.py,sha256=IkhbW42Ng1U5YT3FkIdiB4zBqRkW4QyTb-1detY1e_4,383
|
|
45
45
|
sqlframe/duckdb/readwriter.py,sha256=0qZcARQoWYlx9P2m0uS2vuMj_tG_ka4NhHzg7qdaR3I,4597
|
|
46
46
|
sqlframe/duckdb/session.py,sha256=dj8kOTklBHKTyFGc3UwbgFlloPnfIDUf1Sh4uaO1hSg,2340
|
|
@@ -51,8 +51,8 @@ sqlframe/postgres/__init__.py,sha256=Sz_MtgV_oh_QhfZTC7iKM07ICUmNcJEDV0kEkSW9ZKU
|
|
|
51
51
|
sqlframe/postgres/catalog.py,sha256=9XVXXDW04mY_KmeB52NsCny8n0evqdDCBxhGH1Xce6s,8956
|
|
52
52
|
sqlframe/postgres/column.py,sha256=E1tUa62Y5HajkhgFuebU9zohrGyieudcHzTT8gfalio,40
|
|
53
53
|
sqlframe/postgres/dataframe.py,sha256=f-w6UHxZtmeZ5oMbaqJaZ8FrYeOhzyveNlZOK57ke0k,1289
|
|
54
|
-
sqlframe/postgres/functions.py,sha256=
|
|
55
|
-
sqlframe/postgres/functions.pyi,sha256=
|
|
54
|
+
sqlframe/postgres/functions.py,sha256=iujyPmI6frOCD7pymgBby89DezPHm8dmt75sebhzRaw,2636
|
|
55
|
+
sqlframe/postgres/functions.pyi,sha256=9s7W5QPZXPKqxY6XpkxLCHmC5sp1PkJg1LywgpWTz-k,5550
|
|
56
56
|
sqlframe/postgres/group.py,sha256=KUXeSFKWTSH9yCRJAhW85OvjZaG6Zr4In9LR_ie3yGU,391
|
|
57
57
|
sqlframe/postgres/readwriter.py,sha256=L1e3yKXzFVNR_W5s1DHaWol7G8x7l4jcZ5sLGualyMk,870
|
|
58
58
|
sqlframe/postgres/session.py,sha256=LkM35-ADkIh2OSNT6HRVfJ8jLOoFlrdgkSSVhFGMYRc,2495
|
|
@@ -107,8 +107,8 @@ sqlframe/standalone/udf.py,sha256=azmgtUjHNIPs0WMVNId05SHwiYn41MKVBhKXsQJ5dmY,27
|
|
|
107
107
|
sqlframe/standalone/window.py,sha256=6GKPzuxeSapJakBaKBeT9VpED1ACdjggDv9JRILDyV0,35
|
|
108
108
|
sqlframe/testing/__init__.py,sha256=VVCosQhitU74A3NnE52O4mNtGZONapuEXcc20QmSlnQ,132
|
|
109
109
|
sqlframe/testing/utils.py,sha256=9DDYVuocO7tygee3RaajuJNZ24sJwf_LY556kKg7kTw,13011
|
|
110
|
-
sqlframe-2.
|
|
111
|
-
sqlframe-2.
|
|
112
|
-
sqlframe-2.
|
|
113
|
-
sqlframe-2.
|
|
114
|
-
sqlframe-2.
|
|
110
|
+
sqlframe-2.4.0.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
|
|
111
|
+
sqlframe-2.4.0.dist-info/METADATA,sha256=dfjbBh14A6aUdyiaO4H-rqMVNyChQ7TgncCAwPjjcrQ,7812
|
|
112
|
+
sqlframe-2.4.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
113
|
+
sqlframe-2.4.0.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
|
|
114
|
+
sqlframe-2.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|