sqlframe 3.36.0__py3-none-any.whl → 3.36.1__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 CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '3.36.0'
21
- __version_tuple__ = version_tuple = (3, 36, 0)
20
+ __version__ = version = '3.36.1'
21
+ __version_tuple__ = version_tuple = (3, 36, 1)
@@ -3,6 +3,7 @@ import logging
3
3
  import typing as t
4
4
 
5
5
  from sqlglot import exp
6
+ from typing_extensions import ParamSpec
6
7
 
7
8
  try:
8
9
  from sqlglot.expressions import Whens
@@ -28,21 +29,22 @@ if t.TYPE_CHECKING:
28
29
  logger = logging.getLogger(__name__)
29
30
 
30
31
 
31
- def ensure_cte() -> t.Callable[[t.Callable], t.Callable]:
32
- def decorator(func: t.Callable) -> t.Callable:
33
- @functools.wraps(func)
34
- def wrapper(self: _BaseTable, *args, **kwargs) -> t.Any:
35
- if len(self.expression.ctes) > 0:
36
- return func(self, *args, **kwargs) # type: ignore
37
- self_class = self.__class__
38
- self = self._convert_leaf_to_cte()
39
- self = self_class(**object_to_dict(self))
40
- return func(self, *args, **kwargs) # type: ignore
32
+ P = ParamSpec("P")
33
+ T = t.TypeVar("T")
34
+
41
35
 
42
- wrapper.__wrapped__ = func # type: ignore
43
- return wrapper
36
+ def ensure_cte(func: t.Callable[P, T]) -> t.Callable[P, T]:
37
+ @functools.wraps(func)
38
+ def wrapper(self: _BaseTable, *args: P.args, **kwargs: P.kwargs) -> T:
39
+ if len(self.expression.ctes) > 0:
40
+ return func(self, *args, **kwargs) # type: ignore
41
+ self_class = self.__class__
42
+ self = self._convert_leaf_to_cte()
43
+ self = self_class(**object_to_dict(self))
44
+ return func(self, *args, **kwargs) # type: ignore
44
45
 
45
- return decorator
46
+ wrapper.__wrapped__ = func # type: ignore
47
+ return wrapper # type: ignore[return-value]
46
48
 
47
49
 
48
50
  class _BaseTableMixins(_BaseTable, t.Generic[DF]):
@@ -68,7 +70,7 @@ class _BaseTableMixins(_BaseTable, t.Generic[DF]):
68
70
 
69
71
 
70
72
  class UpdateSupportMixin(_BaseTableMixins, t.Generic[DF]):
71
- @ensure_cte()
73
+ @ensure_cte
72
74
  def update(
73
75
  self,
74
76
  set_: t.Dict[t.Union[Column, str], t.Union[Column, "ColumnOrLiteral", exp.Expression]],
@@ -119,7 +121,7 @@ class UpdateSupportMixin(_BaseTableMixins, t.Generic[DF]):
119
121
 
120
122
 
121
123
  class DeleteSupportMixin(_BaseTableMixins, t.Generic[DF]):
122
- @ensure_cte()
124
+ @ensure_cte
123
125
  def delete(
124
126
  self,
125
127
  where: t.Optional[t.Union[Column, str, bool]] = None,
@@ -141,7 +143,7 @@ class MergeSupportMixin(_BaseTable, t.Generic[DF]):
141
143
  ]
142
144
  _merge_support_star: bool
143
145
 
144
- @ensure_cte()
146
+ @ensure_cte
145
147
  def merge(
146
148
  self,
147
149
  other_df: DF,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sqlframe
3
- Version: 3.36.0
3
+ Version: 3.36.1
4
4
  Summary: Turning PySpark Into a Universal DataFrame API
5
5
  Home-page: https://github.com/eakmanrq/sqlframe
6
6
  Author: Ryan Eakman
@@ -1,5 +1,5 @@
1
1
  sqlframe/__init__.py,sha256=SB80yLTITBXHI2GCDS6n6bN5ObHqgPjfpRPAUwxaots,3403
2
- sqlframe/_version.py,sha256=bkUPQ6OdlXKrD5knIV3EChl0OWjLm_VJDu9m0db4vwg,513
2
+ sqlframe/_version.py,sha256=aFVkO79_dcSzv2bBviVfMu6iWSclcSYamQO4TGPQNMo,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
@@ -25,7 +25,7 @@ sqlframe/base/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
25
25
  sqlframe/base/mixins/catalog_mixins.py,sha256=9fZGWToz9xMJSzUl1vsVtj6TH3TysP3fBCKJLnGUQzE,23353
26
26
  sqlframe/base/mixins/dataframe_mixins.py,sha256=8D2AFtfc0tj9Q5qzlNAXdXOYw9RuD8kpe8wixo8pY5o,1534
27
27
  sqlframe/base/mixins/readwriter_mixins.py,sha256=ItQ_0jZ5RljgmLjGDIzLMRP_NQdy3wAyKwJ6K5NjaqA,4954
28
- sqlframe/base/mixins/table_mixins.py,sha256=2TnGFpbDSGw_NswpZwLACqvdD4zCA7hXekQ9IEkoTOk,13784
28
+ sqlframe/base/mixins/table_mixins.py,sha256=3MhsOARkplwED1GRD0wq1vR8GNuop34kt3Jg8MATIjc,13791
29
29
  sqlframe/bigquery/__init__.py,sha256=kbaomhYAANPdxeDQhajv8IHfMg_ENKivtYK-rPwaV08,939
30
30
  sqlframe/bigquery/catalog.py,sha256=Dcpp1JKftc3ukdYpn6M1ujqixA-6_1k8aY21Y5Johyc,11899
31
31
  sqlframe/bigquery/column.py,sha256=E1tUa62Y5HajkhgFuebU9zohrGyieudcHzTT8gfalio,40
@@ -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.36.0.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
134
- sqlframe-3.36.0.dist-info/METADATA,sha256=F56M3UKMA8CZN2Ps3dAkputINvX8rhBcPKTiAuC5iEs,8987
135
- sqlframe-3.36.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
136
- sqlframe-3.36.0.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
137
- sqlframe-3.36.0.dist-info/RECORD,,
133
+ sqlframe-3.36.1.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
134
+ sqlframe-3.36.1.dist-info/METADATA,sha256=9Osg-ZJKc1nPTLTUkZ6Xz45RmGRqPoHA-0FYCLXv_7U,8987
135
+ sqlframe-3.36.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
136
+ sqlframe-3.36.1.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
137
+ sqlframe-3.36.1.dist-info/RECORD,,