sqlframe 3.30.0__py3-none-any.whl → 3.31.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 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.30.0'
21
- __version_tuple__ = version_tuple = (3, 30, 0)
20
+ __version__ = version = '3.31.0'
21
+ __version_tuple__ = version_tuple = (3, 31, 0)
@@ -678,7 +678,22 @@ def isnull(col: ColumnOrName) -> Column:
678
678
  def last(col: ColumnOrName, ignorenulls: t.Optional[bool] = None) -> Column:
679
679
  this = Column.invoke_expression_over_column(col, expression.Last)
680
680
  if ignorenulls:
681
- return Column.invoke_expression_over_column(this, expression.IgnoreNulls)
681
+ if _get_session()._is_duckdb:
682
+ return Column(
683
+ expression.Filter(
684
+ this=this.expression,
685
+ expression=expression.Where(
686
+ this=expression.Not(
687
+ this=expression.Is(
688
+ this=Column.ensure_col(col).expression,
689
+ expression=expression.Null(),
690
+ )
691
+ )
692
+ ),
693
+ )
694
+ )
695
+ else:
696
+ return Column.invoke_expression_over_column(this, expression.IgnoreNulls)
682
697
  return this
683
698
 
684
699
 
@@ -3872,7 +3887,7 @@ def json_object_keys(col: ColumnOrName) -> Column:
3872
3887
  return Column.invoke_anonymous_function(col, "json_object_keys")
3873
3888
 
3874
3889
 
3875
- @meta(unsupported_engines="*")
3890
+ @meta(unsupported_engines=["bigquery", "postgres", "snowflake"])
3876
3891
  def last_value(col: ColumnOrName, ignoreNulls: t.Optional[t.Union[bool, Column]] = None) -> Column:
3877
3892
  """Returns the last value of `col` for a group of rows. It will return the last non-null
3878
3893
  value it sees when `ignoreNulls` is set to true. If all values are null, then null is returned.
@@ -3913,6 +3928,11 @@ def last_value(col: ColumnOrName, ignoreNulls: t.Optional[t.Union[bool, Column]]
3913
3928
  | b| 2|
3914
3929
  +-------------+-------------+
3915
3930
  """
3931
+ session = _get_session()
3932
+
3933
+ if session._is_duckdb:
3934
+ return last(col, ignoreNulls) # type: ignore
3935
+
3916
3936
  column = Column.invoke_expression_over_column(col, expression.LastValue)
3917
3937
 
3918
3938
  if ignoreNulls:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sqlframe
3
- Version: 3.30.0
3
+ Version: 3.31.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,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.16,>=24.0.0
20
+ Requires-Dist: sqlglot <26.17,>=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'
@@ -1,5 +1,5 @@
1
1
  sqlframe/__init__.py,sha256=SB80yLTITBXHI2GCDS6n6bN5ObHqgPjfpRPAUwxaots,3403
2
- sqlframe/_version.py,sha256=7VpfRH8_mJOR_L4lpWaUQ0WOsohnPcEU5DwM0XACUsI,513
2
+ sqlframe/_version.py,sha256=AgRbmN0zJrj6Fie24WbIl_HozqASkUgbWo9IOWaS7vU,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,7 +9,7 @@ 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=Rc9GfD3tIDg73FPqBAgqIDlrxH-A1c-ZWO76bcViX3w,224169
12
+ sqlframe/base/functions.py,sha256=iReQ8NW4cwTvgGOXQq6WphC3DQbtKjIHDPJZgWjE614,224862
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
@@ -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.30.0.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
134
- sqlframe-3.30.0.dist-info/METADATA,sha256=6o9cQH-Uln7tjo2SsKP9NwsyxJMIIbHp7LLcB3WomO0,8987
135
- sqlframe-3.30.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
136
- sqlframe-3.30.0.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
137
- sqlframe-3.30.0.dist-info/RECORD,,
133
+ sqlframe-3.31.0.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
134
+ sqlframe-3.31.0.dist-info/METADATA,sha256=9D8GGMLw5XslYPUw8U_cEa_Ab4NgB1FRTXW0Wa6lBb0,8987
135
+ sqlframe-3.31.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
136
+ sqlframe-3.31.0.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
137
+ sqlframe-3.31.0.dist-info/RECORD,,