sqlframe 3.43.1__py3-none-any.whl → 3.43.3__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
@@ -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.1'
32
- __version_tuple__ = version_tuple = (3, 43, 1)
31
+ __version__ = version = '3.43.3'
32
+ __version_tuple__ = version_tuple = (3, 43, 3)
33
33
 
34
- __commit_id__ = commit_id = 'g07ceeb0ec'
34
+ __commit_id__ = commit_id = 'gb1808fda1'
@@ -921,8 +921,30 @@ class BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
921
921
  def groupBy(self, *cols, **kwargs) -> GROUP_DATA:
922
922
  if cols and isinstance(cols[0], list):
923
923
  cols = cols[0] # type: ignore
924
+
925
+ # Special handling for groupBy operations with column aliases
926
+ # `_ensure_and_normalize_cols` sets CTE aliases that may not exist in the final context.
924
927
  columns = self._ensure_and_normalize_cols(cols)
925
- return self._group_data(self, columns, self.last_op)
928
+
929
+ # Post-process the columns to fix any issues with CTE aliases
930
+ from sqlframe.base.normalize import (
931
+ _extract_column_name,
932
+ is_column_unambiguously_available,
933
+ )
934
+
935
+ processed_columns: t.List[Column] = []
936
+
937
+ for col in columns:
938
+ # Check if this column has a table qualifier that might be problematic
939
+ if col.column_expression.args.get("table"):
940
+ # Check if the column is unambiguously available without the qualifier
941
+ column_name = _extract_column_name(this) if (this := col.expression.this) else None
942
+ if column_name and is_column_unambiguously_available(self.expression, column_name):
943
+ # Remove the table qualifier if the column is unambiguous
944
+ col.column_expression.set("table", None)
945
+ processed_columns.append(col)
946
+
947
+ return self._group_data(self, processed_columns, self.last_op)
926
948
 
927
949
  groupby = groupBy
928
950
 
@@ -2067,7 +2067,7 @@ def bit_length(col: ColumnOrName) -> Column:
2067
2067
  if session._is_bigquery:
2068
2068
  return bit_length_from_length(col)
2069
2069
 
2070
- return Column.invoke_anonymous_function(col, "BIT_LENGTH")
2070
+ return Column.invoke_expression_over_column(col, expression.BitLength)
2071
2071
 
2072
2072
 
2073
2073
  @meta()
@@ -4881,10 +4881,9 @@ def parse_url(
4881
4881
  >>> df.select(parse_url(df.a, df.b).alias('r')).collect()
4882
4882
  [Row(r='query=1')]
4883
4883
  """
4884
- if key is not None:
4885
- return Column.invoke_anonymous_function(url, "parse_url", partToExtract, key)
4886
- else:
4887
- return Column.invoke_anonymous_function(url, "parse_url", partToExtract)
4884
+ return Column.invoke_expression_over_column(
4885
+ url, expression.ParseUrl, part_to_extract=partToExtract, key=key
4886
+ )
4888
4887
 
4889
4888
 
4890
4889
  @meta(unsupported_engines="*")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sqlframe
3
- Version: 3.43.1
3
+ Version: 3.43.3
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.17,>=24.0.0
21
+ Requires-Dist: sqlglot <27.20,>=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'
@@ -1,15 +1,15 @@
1
1
  sqlframe/__init__.py,sha256=SB80yLTITBXHI2GCDS6n6bN5ObHqgPjfpRPAUwxaots,3403
2
- sqlframe/_version.py,sha256=J2b9R7RcIQKVNt66tZoZMlGnx0Hhbva3g6YxYwpILD4,714
2
+ sqlframe/_version.py,sha256=ithysrwvYEle9Lh5s96SdKryDe4FRzu7cmZhMXwOrA8,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
6
6
  sqlframe/base/catalog.py,sha256=-YulM2BMK8MoWbXi05AsJIPxd4AuiZDBCZuk4HoeMlE,38900
7
7
  sqlframe/base/column.py,sha256=f6rK6-hTiNx9WwJP7t6tqL3xEC2gwERPDlhWCS5iCBw,21417
8
- sqlframe/base/dataframe.py,sha256=wT3R2Qmq4edOefxXCRepiMDNJfVOIvSf6eHd6GOn4i0,88543
8
+ sqlframe/base/dataframe.py,sha256=3vlZij84GUKpS23DZSrTRm0mi5SRFjZv_BSn4rAJ0IE,89614
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=bA6LuduIBcBgG9mE1GXmrO0zxcPV_Yx8pytRoqOZ0Zo,229602
12
+ sqlframe/base/functions.py,sha256=g7BVwWrBTtB5UgMK7UL1zodKMIcxuna5nRhyhfejD5k,229541
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=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.43.1.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
134
- sqlframe-3.43.1.dist-info/METADATA,sha256=QRiDOgcTBZwCscawbAcGZzIXpzlWE1tfbysgGDLzOnU,9070
135
- sqlframe-3.43.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
136
- sqlframe-3.43.1.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
137
- sqlframe-3.43.1.dist-info/RECORD,,
133
+ sqlframe-3.43.3.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
134
+ sqlframe-3.43.3.dist-info/METADATA,sha256=-7wuJ8cmULE1ITa7znzPc_1H6FdlzzRyFLZ5GNVjRB8,9070
135
+ sqlframe-3.43.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
136
+ sqlframe-3.43.3.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
137
+ sqlframe-3.43.3.dist-info/RECORD,,