ygo 1.0.7__py3-none-any.whl → 1.0.8__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.
Potentially problematic release.
This version of ygo might be problematic. Click here for more details.
- qdf/qdf.py +8 -6
- {ygo-1.0.7.dist-info → ygo-1.0.8.dist-info}/METADATA +1 -1
- {ygo-1.0.7.dist-info → ygo-1.0.8.dist-info}/RECORD +6 -6
- {ygo-1.0.7.dist-info → ygo-1.0.8.dist-info}/WHEEL +0 -0
- {ygo-1.0.7.dist-info → ygo-1.0.8.dist-info}/licenses/LICENSE +0 -0
- {ygo-1.0.7.dist-info → ygo-1.0.8.dist-info}/top_level.txt +0 -0
qdf/qdf.py
CHANGED
|
@@ -56,6 +56,7 @@ class QDF:
|
|
|
56
56
|
self.failed = list()
|
|
57
57
|
self._expr_cache = dict() # type: dict[Expr, str]
|
|
58
58
|
self._cur_expr_cache = dict()
|
|
59
|
+
self._data_: pl.LazyFrame = None
|
|
59
60
|
|
|
60
61
|
def __str__(self):
|
|
61
62
|
return self.data.__str__()
|
|
@@ -111,6 +112,7 @@ class QDF:
|
|
|
111
112
|
args.append(arg) # or args.append(pl.lit(arg))
|
|
112
113
|
try:
|
|
113
114
|
expr_pl: pl.Expr = func(*args, **kwargs).alias(alias_)
|
|
115
|
+
self._data_ = self._data_.with_columns(expr_pl)
|
|
114
116
|
self._cur_expr_cache[expr_] = alias_
|
|
115
117
|
return expr_pl
|
|
116
118
|
except Exception as e:
|
|
@@ -118,7 +120,6 @@ class QDF:
|
|
|
118
120
|
|
|
119
121
|
return recur_compile(expr_parsed), alias
|
|
120
122
|
except (CalculateError, CompileError, PolarsError) as e:
|
|
121
|
-
# 已经是你自己的错误类
|
|
122
123
|
raise e
|
|
123
124
|
except Exception as e:
|
|
124
125
|
# 所有未处理的错误统一抛出为 CompileError
|
|
@@ -143,7 +144,7 @@ class QDF:
|
|
|
143
144
|
exprs_to_add = list()
|
|
144
145
|
exprs_select = list()
|
|
145
146
|
self._cur_expr_cache = {}
|
|
146
|
-
|
|
147
|
+
self._data_ = self.data.lazy()
|
|
147
148
|
|
|
148
149
|
for expr in exprs:
|
|
149
150
|
try:
|
|
@@ -155,12 +156,13 @@ class QDF:
|
|
|
155
156
|
self.failed.append(FailError(expr, e))
|
|
156
157
|
if self.failed:
|
|
157
158
|
ylog.warning(f"QDF.sql 失败:{len(self.failed)}/{len(exprs)}: \n {self.failed}")
|
|
158
|
-
for expr in exprs_to_add:
|
|
159
|
-
|
|
159
|
+
# for expr in exprs_to_add:
|
|
160
|
+
# data = data.with_columns(expr).fill_nan(None)
|
|
161
|
+
self._data_ = self._data_.with_columns(*exprs_to_add).fill_nan(None)
|
|
160
162
|
new_expr_cache = dict()
|
|
161
163
|
try:
|
|
162
|
-
self.data =
|
|
163
|
-
final_df = self.data.select(*self.index, *
|
|
164
|
+
self.data = self._data_.collect()
|
|
165
|
+
final_df = self.data.select(*self.index, *exprs_select)
|
|
164
166
|
current_cols = set(self.data.columns)
|
|
165
167
|
# 缓存整理:只保留当前表达式的缓存
|
|
166
168
|
self._expr_cache.update(self._cur_expr_cache)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
qdf/__init__.py,sha256=XwH17ae6kX5Grhb_odgDqkNf6N-ambTVi3LoGzq1Fmc,7519
|
|
2
2
|
qdf/errors.py,sha256=lJhhjDRdQOOKUFGlLQ9ELK4AexXBwYQSYus_V-kc5K8,1180
|
|
3
3
|
qdf/expr.py,sha256=ck_BHMCV29Q8-szci1_v4ud964QI7JoRRcmA0ppupsc,8454
|
|
4
|
-
qdf/qdf.py,sha256=
|
|
4
|
+
qdf/qdf.py,sha256=X3n2eB9C2Jm7dP4d_j-P9QvL5DJ9X1fe7GZfn3afxeU,7411
|
|
5
5
|
qdf/udf/__init__.py,sha256=DdrSGaCB__5C1YL0vd_5rjIB3KLrAKn3h3k9k50L0jA,313
|
|
6
6
|
qdf/udf/base_udf.py,sha256=6VDaCIGNLJxZ7UsoIDWtTH6PzUDj89b8FiwN-TEat2g,3437
|
|
7
7
|
qdf/udf/cs_udf.py,sha256=HT3EKBwAhOxOFDQnpfwb4YcMTT3-lqFXkdysdn5_FI4,3179
|
|
@@ -16,10 +16,10 @@ ycat/yck.py,sha256=FlGMBuKEngB4TwFXMp4P3dLg9IfFmUg3eDqXzQ0kQoI,2738
|
|
|
16
16
|
ygo/__init__.py,sha256=FMN06Tfa8_oV26eklBZCtGTyHZ6MghHxHj4PS_FSXCA,222
|
|
17
17
|
ygo/exceptions.py,sha256=4Kd92kpwpsXHJJkSv4OqcN--PEEvIGGvDDgOOsk68gg,385
|
|
18
18
|
ygo/ygo.py,sha256=vCMUur_41yY0QB4gj8K5wBZHql_cbmANhI8QwPRCTmo,11613
|
|
19
|
-
ygo-1.0.
|
|
19
|
+
ygo-1.0.8.dist-info/licenses/LICENSE,sha256=6AKUWQ1xe-jwPSFv_H6FMQLNNWb7AYqzuEUTwlP2S8M,1067
|
|
20
20
|
ylog/__init__.py,sha256=2sIp4PHNoQMCi0QtIarTI4raACd7SdRHNY7fY5hKYwc,397
|
|
21
21
|
ylog/core.py,sha256=jmz9JhklbVCQz-zahEXV6P-LEHnqU6opnY4CUEyo8Ss,7924
|
|
22
|
-
ygo-1.0.
|
|
23
|
-
ygo-1.0.
|
|
24
|
-
ygo-1.0.
|
|
25
|
-
ygo-1.0.
|
|
22
|
+
ygo-1.0.8.dist-info/METADATA,sha256=21pVOKJzFEmudbQyApruzgFa0O2PymVE5c5m06fNrzM,2076
|
|
23
|
+
ygo-1.0.8.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
24
|
+
ygo-1.0.8.dist-info/top_level.txt,sha256=FGbsOtsHgqWzZ9mGRSTCg0pLZEErR1lq5TFQSy2TL1w,18
|
|
25
|
+
ygo-1.0.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|