sqlframe 3.28.0__py3-none-any.whl → 3.28.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 +2 -2
- sqlframe/base/dataframe.py +4 -6
- sqlframe/base/group.py +7 -3
- {sqlframe-3.28.0.dist-info → sqlframe-3.28.2.dist-info}/METADATA +1 -1
- {sqlframe-3.28.0.dist-info → sqlframe-3.28.2.dist-info}/RECORD +8 -8
- {sqlframe-3.28.0.dist-info → sqlframe-3.28.2.dist-info}/LICENSE +0 -0
- {sqlframe-3.28.0.dist-info → sqlframe-3.28.2.dist-info}/WHEEL +0 -0
- {sqlframe-3.28.0.dist-info → sqlframe-3.28.2.dist-info}/top_level.txt +0 -0
sqlframe/_version.py
CHANGED
sqlframe/base/dataframe.py
CHANGED
@@ -80,8 +80,6 @@ JOIN_HINTS = {
|
|
80
80
|
}
|
81
81
|
|
82
82
|
JOIN_TYPE_MAPPING = {
|
83
|
-
"inner": "inner",
|
84
|
-
"cross": "cross",
|
85
83
|
"outer": "full_outer",
|
86
84
|
"full": "full_outer",
|
87
85
|
"fullouter": "full_outer",
|
@@ -91,10 +89,8 @@ JOIN_TYPE_MAPPING = {
|
|
91
89
|
"rightouter": "right_outer",
|
92
90
|
"semi": "left_semi",
|
93
91
|
"leftsemi": "left_semi",
|
94
|
-
"left_semi": "left_semi",
|
95
92
|
"anti": "left_anti",
|
96
93
|
"leftanti": "left_anti",
|
97
|
-
"left_anti": "left_anti",
|
98
94
|
}
|
99
95
|
|
100
96
|
DF = t.TypeVar("DF", bound="BaseDataFrame")
|
@@ -910,6 +906,8 @@ class BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
910
906
|
|
911
907
|
@operation(Operation.GROUP_BY)
|
912
908
|
def groupBy(self, *cols, **kwargs) -> GROUP_DATA:
|
909
|
+
if cols and isinstance(cols[0], list):
|
910
|
+
cols = cols[0] # type: ignore
|
913
911
|
columns = self._ensure_and_normalize_cols(cols)
|
914
912
|
return self._group_data(self, columns, self.last_op)
|
915
913
|
|
@@ -1026,7 +1024,7 @@ class BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
1026
1024
|
@operation(Operation.FROM)
|
1027
1025
|
def join(
|
1028
1026
|
self,
|
1029
|
-
|
1027
|
+
other: Self,
|
1030
1028
|
on: t.Optional[t.Union[str, t.List[str], Column, t.List[Column]]] = None,
|
1031
1029
|
how: str = "inner",
|
1032
1030
|
**kwargs,
|
@@ -1042,7 +1040,7 @@ class BaseDataFrame(t.Generic[SESSION, WRITER, NA, STAT, GROUP_DATA]):
|
|
1042
1040
|
logger.warning("Got cross join with an 'on' value. This will result in an inner join.")
|
1043
1041
|
how = "inner"
|
1044
1042
|
|
1045
|
-
other_df =
|
1043
|
+
other_df = other._convert_leaf_to_cte()
|
1046
1044
|
join_expression = self._add_ctes_to_expression(self.expression, other_df.expression.ctes)
|
1047
1045
|
# We will determine actual "join on" expression later so we don't provide it at first
|
1048
1046
|
join_type = JOIN_TYPE_MAPPING.get(how, how).replace("_", " ")
|
sqlframe/base/group.py
CHANGED
@@ -47,7 +47,10 @@ class _BaseGroupedData(t.Generic[DF]):
|
|
47
47
|
from sqlframe.base.column import Column
|
48
48
|
|
49
49
|
columns = (
|
50
|
-
[
|
50
|
+
[
|
51
|
+
self._get_function_applied_columns(agg_func, (column_name,))[0]
|
52
|
+
for column_name, agg_func in exprs[0].items()
|
53
|
+
]
|
51
54
|
if isinstance(exprs[0], dict)
|
52
55
|
else exprs
|
53
56
|
)
|
@@ -55,7 +58,8 @@ class _BaseGroupedData(t.Generic[DF]):
|
|
55
58
|
|
56
59
|
if not self.group_by_cols or not isinstance(self.group_by_cols[0], (list, tuple, set)):
|
57
60
|
expression = self._df.expression.group_by(
|
58
|
-
|
61
|
+
# User column_expression for group by to avoid alias in group by
|
62
|
+
*[x.column_expression for x in self.group_by_cols] # type: ignore
|
59
63
|
).select(*[x.expression for x in self.group_by_cols + cols], append=False) # type: ignore
|
60
64
|
group_by_cols = self.group_by_cols
|
61
65
|
else:
|
@@ -66,7 +70,7 @@ class _BaseGroupedData(t.Generic[DF]):
|
|
66
70
|
group_by_cols = []
|
67
71
|
for grouping_set in self.group_by_cols:
|
68
72
|
all_grouping_sets.append(
|
69
|
-
exp.Tuple(expressions=[x.
|
73
|
+
exp.Tuple(expressions=[x.column_expression for x in grouping_set]) # type: ignore
|
70
74
|
)
|
71
75
|
group_by_cols.extend(grouping_set) # type: ignore
|
72
76
|
group_by_cols = list(dict.fromkeys(group_by_cols))
|
@@ -1,16 +1,16 @@
|
|
1
1
|
sqlframe/__init__.py,sha256=SB80yLTITBXHI2GCDS6n6bN5ObHqgPjfpRPAUwxaots,3403
|
2
|
-
sqlframe/_version.py,sha256=
|
2
|
+
sqlframe/_version.py,sha256=9o0IPCovPUOxBDHRN7R9Zcb381abgRZxXFEyPESsRhg,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
|
6
6
|
sqlframe/base/catalog.py,sha256=ZuU_qmt4yjSoTYgecSGnOhitOdh3rJbGCUjnUBp5mlc,38564
|
7
7
|
sqlframe/base/column.py,sha256=AG9Z_6RNhVxLhLU29kRCgzMgDNSm-_GFg96xLqk1-bs,19838
|
8
|
-
sqlframe/base/dataframe.py,sha256=
|
8
|
+
sqlframe/base/dataframe.py,sha256=DEdpFEUbbz9daxC_d-_tbeyctdF7upJezfhZ9bNbfp4,84028
|
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
12
|
sqlframe/base/functions.py,sha256=Rc9GfD3tIDg73FPqBAgqIDlrxH-A1c-ZWO76bcViX3w,224169
|
13
|
-
sqlframe/base/group.py,sha256=
|
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
|
16
16
|
sqlframe/base/readerwriter.py,sha256=Nb2VJ_HBmLQp5mK8JhnFooZh2ydAaboCAFVPb-4MNX4,31241
|
@@ -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.28.
|
134
|
-
sqlframe-3.28.
|
135
|
-
sqlframe-3.28.
|
136
|
-
sqlframe-3.28.
|
137
|
-
sqlframe-3.28.
|
133
|
+
sqlframe-3.28.2.dist-info/LICENSE,sha256=VZu79YgW780qxaFJMr0t5ZgbOYEh04xWoxaWOaqIGWk,1068
|
134
|
+
sqlframe-3.28.2.dist-info/METADATA,sha256=oAw2UR3arflqdajH11cfP0uG0uI9PL2-Emy9nMiExVQ,8971
|
135
|
+
sqlframe-3.28.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
136
|
+
sqlframe-3.28.2.dist-info/top_level.txt,sha256=T0_RpoygaZSF6heeWwIDQgaP0varUdSK1pzjeJZRjM8,9
|
137
|
+
sqlframe-3.28.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|