sqlframe 3.14.1__py3-none-any.whl → 3.14.2__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
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '3.14.1'
16
- __version_tuple__ = version_tuple = (3, 14, 1)
15
+ __version__ = version = '3.14.2'
16
+ __version_tuple__ = version_tuple = (3, 14, 2)
@@ -9,6 +9,7 @@ import json
9
9
  import logging
10
10
  import sys
11
11
  import typing as t
12
+ import uuid
12
13
  import zlib
13
14
  from copy import copy
14
15
  from dataclasses import dataclass
@@ -491,22 +492,20 @@ class BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
491
492
  with_expression = expression.args.get("with")
492
493
  if with_expression:
493
494
  existing_ctes = with_expression.expressions
494
- existing_cte_counts = {x.alias_or_name: 0 for x in existing_ctes}
495
+ existing_cte_names = {x.alias_or_name for x in existing_ctes}
495
496
  replaced_cte_names = {} # type: ignore
496
497
  for cte in ctes:
497
498
  if replaced_cte_names:
498
499
  cte = cte.transform(replace_id_value, replaced_cte_names) # type: ignore
499
- if cte.alias_or_name in existing_cte_counts:
500
- existing_cte_counts[cte.alias_or_name] += 10
500
+ if cte.alias_or_name in existing_cte_names:
501
+ random_filter = exp.Literal.string(uuid.uuid4().hex)
501
502
  # Add unique where filter to ensure that the hash of the CTE is unique
502
503
  cte.set(
503
504
  "this",
504
505
  cte.this.where(
505
506
  exp.EQ(
506
- this=exp.Literal.number(existing_cte_counts[cte.alias_or_name]),
507
- expression=exp.Literal.number(
508
- existing_cte_counts[cte.alias_or_name]
509
- ),
507
+ this=random_filter,
508
+ expression=random_filter,
510
509
  )
511
510
  ),
512
511
  )
@@ -520,7 +519,7 @@ class BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
520
519
  new_cte_alias, dialect=self.session.input_dialect, into=exp.TableAlias
521
520
  ),
522
521
  )
523
- existing_cte_counts[new_cte_alias] = 0
522
+ existing_cte_names.add(new_cte_alias)
524
523
  existing_ctes.append(cte)
525
524
  else:
526
525
  existing_ctes = ctes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sqlframe
3
- Version: 3.14.1
3
+ Version: 3.14.2
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,10 +1,10 @@
1
1
  sqlframe/__init__.py,sha256=wfqm98eLoLid9oV_FzzpG5loKC6LxOhj2lXpfN7SARo,3138
2
- sqlframe/_version.py,sha256=TK0msIUEaLkvUHhRM_fUlCaK-1zpNU289vecbm9mQbk,413
2
+ sqlframe/_version.py,sha256=jOmVUgfrjHuKbVMclbnyeOg5hq5CSFD43rU-r3QVgI8,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=7PMHXTaYDpXXLUE4wLaEUS9mCQnuspZI3MAIGO08pzk,76716
7
+ sqlframe/base/dataframe.py,sha256=E1zWlB_a2FNOxjTcQ68MtL_A4c8fnLiHY3MeZttK4Xk,76570
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
@@ -129,8 +129,8 @@ sqlframe/standalone/udf.py,sha256=azmgtUjHNIPs0WMVNId05SHwiYn41MKVBhKXsQJ5dmY,27
129
129
  sqlframe/standalone/window.py,sha256=6GKPzuxeSapJakBaKBeT9VpED1ACdjggDv9JRILDyV0,35
130
130
  sqlframe/testing/__init__.py,sha256=VVCosQhitU74A3NnE52O4mNtGZONapuEXcc20QmSlnQ,132
131
131
  sqlframe/testing/utils.py,sha256=PFsGZpwNUE_4-g_f43_vstTqsK0AQ2lBneb5Eb6NkFo,13008
132
- sqlframe-3.14.1.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
133
- sqlframe-3.14.1.dist-info/METADATA,sha256=35g-WMlgVgbqNTvaWacRcdKRlCbprzZj390VrP0___w,8970
134
- sqlframe-3.14.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
135
- sqlframe-3.14.1.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
136
- sqlframe-3.14.1.dist-info/RECORD,,
132
+ sqlframe-3.14.2.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
133
+ sqlframe-3.14.2.dist-info/METADATA,sha256=jaarma0pQSOhwGo8XtkdteTdJadSB4CIiVrjLLQovu0,8970
134
+ sqlframe-3.14.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
135
+ sqlframe-3.14.2.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
136
+ sqlframe-3.14.2.dist-info/RECORD,,