ygo 1.0.7__tar.gz → 1.0.9__tar.gz

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.

Files changed (30) hide show
  1. {ygo-1.0.7/ygo.egg-info → ygo-1.0.9}/PKG-INFO +1 -1
  2. {ygo-1.0.7 → ygo-1.0.9}/pyproject.toml +1 -1
  3. {ygo-1.0.7 → ygo-1.0.9}/qdf/qdf.py +8 -8
  4. {ygo-1.0.7 → ygo-1.0.9/ygo.egg-info}/PKG-INFO +1 -1
  5. {ygo-1.0.7 → ygo-1.0.9}/LICENSE +0 -0
  6. {ygo-1.0.7 → ygo-1.0.9}/README.md +0 -0
  7. {ygo-1.0.7 → ygo-1.0.9}/qdf/__init__.py +0 -0
  8. {ygo-1.0.7 → ygo-1.0.9}/qdf/errors.py +0 -0
  9. {ygo-1.0.7 → ygo-1.0.9}/qdf/expr.py +0 -0
  10. {ygo-1.0.7 → ygo-1.0.9}/qdf/udf/__init__.py +0 -0
  11. {ygo-1.0.7 → ygo-1.0.9}/qdf/udf/base_udf.py +0 -0
  12. {ygo-1.0.7 → ygo-1.0.9}/qdf/udf/cs_udf.py +0 -0
  13. {ygo-1.0.7 → ygo-1.0.9}/qdf/udf/d_udf.py +0 -0
  14. {ygo-1.0.7 → ygo-1.0.9}/qdf/udf/ind_udf.py +0 -0
  15. {ygo-1.0.7 → ygo-1.0.9}/qdf/udf/ts_udf.py +0 -0
  16. {ygo-1.0.7 → ygo-1.0.9}/setup.cfg +0 -0
  17. {ygo-1.0.7 → ygo-1.0.9}/ycat/__init__.py +0 -0
  18. {ygo-1.0.7 → ygo-1.0.9}/ycat/client.py +0 -0
  19. {ygo-1.0.7 → ygo-1.0.9}/ycat/dtype.py +0 -0
  20. {ygo-1.0.7 → ygo-1.0.9}/ycat/parse.py +0 -0
  21. {ygo-1.0.7 → ygo-1.0.9}/ycat/yck.py +0 -0
  22. {ygo-1.0.7 → ygo-1.0.9}/ygo/__init__.py +0 -0
  23. {ygo-1.0.7 → ygo-1.0.9}/ygo/exceptions.py +0 -0
  24. {ygo-1.0.7 → ygo-1.0.9}/ygo/ygo.py +0 -0
  25. {ygo-1.0.7 → ygo-1.0.9}/ygo.egg-info/SOURCES.txt +0 -0
  26. {ygo-1.0.7 → ygo-1.0.9}/ygo.egg-info/dependency_links.txt +0 -0
  27. {ygo-1.0.7 → ygo-1.0.9}/ygo.egg-info/requires.txt +0 -0
  28. {ygo-1.0.7 → ygo-1.0.9}/ygo.egg-info/top_level.txt +0 -0
  29. {ygo-1.0.7 → ygo-1.0.9}/ylog/__init__.py +0 -0
  30. {ygo-1.0.7 → ygo-1.0.9}/ylog/core.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ygo
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Project-URL: homepage, https://github.com/link-yundi/ygo
5
5
  Project-URL: repository, https://github.com/link-yundi/ygo
6
6
  Requires-Python: >=3.8
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ygo"
7
- version = "1.0.7"
7
+ version = "1.0.9"
8
8
  description = ""
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -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__()
@@ -110,15 +111,15 @@ class QDF:
110
111
  else:
111
112
  args.append(arg) # or args.append(pl.lit(arg))
112
113
  try:
113
- expr_pl: pl.Expr = func(*args, **kwargs).alias(alias_)
114
+ expr_pl: pl.Expr = func(*args, **kwargs)
115
+ self._data_ = self._data_.with_columns(expr_pl.alias(alias_))
114
116
  self._cur_expr_cache[expr_] = alias_
115
- return expr_pl
117
+ return pl.col(alias_)
116
118
  except Exception as e:
117
119
  raise CompileError(message=f"{expr_.fn_name}({', '.join([str(arg) for arg in args])})\n{e}") from e
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
- data = self.data.lazy()
147
+ self._data_ = self.data.lazy()
147
148
 
148
149
  for expr in exprs:
149
150
  try:
@@ -155,12 +156,11 @@ 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
- data = data.with_columns(expr).fill_nan(None)
159
+ self._data_ = self._data_.with_columns(*exprs_to_add).fill_nan(None)
160
160
  new_expr_cache = dict()
161
161
  try:
162
- self.data = data.collect()
163
- final_df = self.data.select(*self.index, *exprs_to_add)
162
+ self.data = self._data_.collect()
163
+ final_df = self.data.select(*self.index, *exprs_select)
164
164
  current_cols = set(self.data.columns)
165
165
  # 缓存整理:只保留当前表达式的缓存
166
166
  self._expr_cache.update(self._cur_expr_cache)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ygo
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Project-URL: homepage, https://github.com/link-yundi/ygo
5
5
  Project-URL: repository, https://github.com/link-yundi/ygo
6
6
  Requires-Python: >=3.8
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes