sqlframe 3.13.2__py3-none-any.whl → 3.13.4__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/dataframe.py +10 -3
- sqlframe/base/session.py +1 -1
- {sqlframe-3.13.2.dist-info → sqlframe-3.13.4.dist-info}/METADATA +1 -1
- {sqlframe-3.13.2.dist-info → sqlframe-3.13.4.dist-info}/RECORD +8 -8
- {sqlframe-3.13.2.dist-info → sqlframe-3.13.4.dist-info}/LICENSE +0 -0
- {sqlframe-3.13.2.dist-info → sqlframe-3.13.4.dist-info}/WHEEL +0 -0
- {sqlframe-3.13.2.dist-info → sqlframe-3.13.4.dist-info}/top_level.txt +0 -0
sqlframe/_version.py
CHANGED
sqlframe/base/dataframe.py
CHANGED
|
@@ -481,6 +481,7 @@ class BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
|
481
481
|
cte = cte.transform(replace_id_value, replaced_cte_names) # type: ignore
|
|
482
482
|
if cte.alias_or_name in existing_cte_counts:
|
|
483
483
|
existing_cte_counts[cte.alias_or_name] += 10
|
|
484
|
+
# Add unique where filter to ensure that the hash of the CTE is unique
|
|
484
485
|
cte.set(
|
|
485
486
|
"this",
|
|
486
487
|
cte.this.where(
|
|
@@ -502,6 +503,7 @@ class BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
|
502
503
|
new_cte_alias, dialect=self.session.input_dialect, into=exp.TableAlias
|
|
503
504
|
),
|
|
504
505
|
)
|
|
506
|
+
existing_cte_counts[new_cte_alias] = 0
|
|
505
507
|
existing_ctes.append(cte)
|
|
506
508
|
else:
|
|
507
509
|
existing_ctes = ctes
|
|
@@ -755,15 +757,20 @@ class BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
|
755
757
|
]
|
|
756
758
|
cte_names_in_join = [x.this for x in join_table_identifiers]
|
|
757
759
|
# If we have columns that resolve to multiple CTE expressions then we want to use each CTE left-to-right
|
|
758
|
-
# and therefore we allow multiple columns with the same
|
|
759
|
-
# of Spark.
|
|
760
|
+
# (or right to left if a right join) and therefore we allow multiple columns with the same
|
|
761
|
+
# name in the result. This matches the behavior of Spark.
|
|
760
762
|
resolved_column_position: t.Dict[exp.Column, int] = {
|
|
761
763
|
col.copy(): -1 for col in ambiguous_cols
|
|
762
764
|
}
|
|
763
765
|
for ambiguous_col in ambiguous_cols:
|
|
766
|
+
ctes = (
|
|
767
|
+
list(reversed(self.expression.ctes))
|
|
768
|
+
if self.expression.args["joins"][0].args.get("side", "") == "right"
|
|
769
|
+
else self.expression.ctes
|
|
770
|
+
)
|
|
764
771
|
ctes_with_column = [
|
|
765
772
|
cte
|
|
766
|
-
for cte in
|
|
773
|
+
for cte in ctes
|
|
767
774
|
if cte.alias_or_name in cte_names_in_join
|
|
768
775
|
and ambiguous_col.alias_or_name in cte.this.named_selects
|
|
769
776
|
]
|
sqlframe/base/session.py
CHANGED
|
@@ -548,7 +548,7 @@ class _BaseSession(t.Generic[CATALOG, READER, WRITER, DF, CONN, UDF_REGISTRATION
|
|
|
548
548
|
normalize_identifiers(expression, dialect=dialect)
|
|
549
549
|
if quote_identifiers:
|
|
550
550
|
quote_identifiers_func(expression, dialect=dialect)
|
|
551
|
-
return optimize(expression, dialect=dialect, schema=self.catalog._schema)
|
|
551
|
+
return optimize(expression, dialect=dialect, schema=self.catalog._schema, infer_schema=True)
|
|
552
552
|
|
|
553
553
|
def _execute(self, sql: str) -> None:
|
|
554
554
|
self._cur.execute(sql)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
sqlframe/__init__.py,sha256=wfqm98eLoLid9oV_FzzpG5loKC6LxOhj2lXpfN7SARo,3138
|
|
2
|
-
sqlframe/_version.py,sha256=
|
|
2
|
+
sqlframe/_version.py,sha256=7_6ZiCN2IEbqvGolC1tvkUZXIMID8-9wKt9GAmhPeyU,413
|
|
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
6
|
sqlframe/base/column.py,sha256=wRghgieYAA51aw4WuFQWOvl0TFOToZbBhBuIamEzxx4,18011
|
|
7
|
-
sqlframe/base/dataframe.py,sha256=
|
|
7
|
+
sqlframe/base/dataframe.py,sha256=Z_ao91TOoOMtyc32VwK5lXaH_-grchMEgk-V4fDBsRQ,75363
|
|
8
8
|
sqlframe/base/decorators.py,sha256=P56cgs8DANxGRIwVs5uOMnDy-BlXZZYMbf4fdnkpWPI,1889
|
|
9
9
|
sqlframe/base/exceptions.py,sha256=9Uwvqn2eAkDpqm4BrRgbL61qM-GMCbJEMAW8otxO46s,370
|
|
10
10
|
sqlframe/base/function_alternatives.py,sha256=8kDCh1cOXtdCcBPYBQ8byXxRAZvphS9N8GDs4txBzGg,52544
|
|
@@ -13,7 +13,7 @@ sqlframe/base/group.py,sha256=fsyG5990_Pd7gFPjTFrH9IEoAquL_wEkVpIlBAIkZJU,4091
|
|
|
13
13
|
sqlframe/base/normalize.py,sha256=nXAJ5CwxVf4DV0GsH-q1w0p8gmjSMlv96k_ez1eVul8,3880
|
|
14
14
|
sqlframe/base/operations.py,sha256=xSPw74e59wYvNd6U1AlwziNCTG6Aftrbl4SybN9u9VE,3450
|
|
15
15
|
sqlframe/base/readerwriter.py,sha256=9cgOZuB3phZbQufY98JRDBVWRww3hsULc6Or1HK2Onk,26554
|
|
16
|
-
sqlframe/base/session.py,sha256=
|
|
16
|
+
sqlframe/base/session.py,sha256=a4F4ql7nyXJYUbrrKFdoVtnyCyri-ji0pvSn53Uevpk,25960
|
|
17
17
|
sqlframe/base/transforms.py,sha256=y0j3SGDz3XCmNGrvassk1S-owllUWfkHyMgZlY6SFO4,467
|
|
18
18
|
sqlframe/base/types.py,sha256=iBNk9bpFtb2NBIogYS8i7OlQZMRvpR6XxqzBebsjQDU,12280
|
|
19
19
|
sqlframe/base/udf.py,sha256=O6hMhBUy9NVv-mhJRtfFhXTIa_-Z8Y_FkmmuOHu0l90,1117
|
|
@@ -119,8 +119,8 @@ sqlframe/standalone/udf.py,sha256=azmgtUjHNIPs0WMVNId05SHwiYn41MKVBhKXsQJ5dmY,27
|
|
|
119
119
|
sqlframe/standalone/window.py,sha256=6GKPzuxeSapJakBaKBeT9VpED1ACdjggDv9JRILDyV0,35
|
|
120
120
|
sqlframe/testing/__init__.py,sha256=VVCosQhitU74A3NnE52O4mNtGZONapuEXcc20QmSlnQ,132
|
|
121
121
|
sqlframe/testing/utils.py,sha256=PFsGZpwNUE_4-g_f43_vstTqsK0AQ2lBneb5Eb6NkFo,13008
|
|
122
|
-
sqlframe-3.13.
|
|
123
|
-
sqlframe-3.13.
|
|
124
|
-
sqlframe-3.13.
|
|
125
|
-
sqlframe-3.13.
|
|
126
|
-
sqlframe-3.13.
|
|
122
|
+
sqlframe-3.13.4.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
|
|
123
|
+
sqlframe-3.13.4.dist-info/METADATA,sha256=l3ePEWivSaLRcSXkbArcgj3_ENj6eU1WT_b3XifqndA,8970
|
|
124
|
+
sqlframe-3.13.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
125
|
+
sqlframe-3.13.4.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
|
|
126
|
+
sqlframe-3.13.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|