graphty 0.3.0__tar.gz → 0.4.0__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.
Files changed (30) hide show
  1. {graphty-0.3.0 → graphty-0.4.0}/PKG-INFO +1 -1
  2. {graphty-0.3.0 → graphty-0.4.0}/pyproject.toml +1 -1
  3. graphty-0.4.0/src/graphty/.ruff_cache/0.15.17/18262235589301934996 +0 -0
  4. graphty-0.4.0/src/graphty/.ruff_cache/0.15.17/8059422986951603277 +0 -0
  5. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/materializer.py +1 -1
  6. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/planner.py +13 -8
  7. graphty-0.4.0/src/graphty/utils/.ruff_cache/0.15.17/3781096723789676511 +0 -0
  8. graphty-0.4.0/src/graphty/utils/.ruff_cache/0.15.17/6602623227124377539 +0 -0
  9. graphty-0.3.0/src/graphty/.ruff_cache/0.15.17/18262235589301934996 +0 -0
  10. graphty-0.3.0/src/graphty/.ruff_cache/0.15.17/8059422986951603277 +0 -0
  11. graphty-0.3.0/src/graphty/utils/.ruff_cache/0.15.17/3781096723789676511 +0 -0
  12. graphty-0.3.0/src/graphty/utils/.ruff_cache/0.15.17/6602623227124377539 +0 -0
  13. {graphty-0.3.0 → graphty-0.4.0}/README.md +0 -0
  14. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/.ruff_cache/.gitignore +0 -0
  15. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/.ruff_cache/0.14.6/1516144176499143322 +0 -0
  16. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/.ruff_cache/0.14.6/16552783075482950175 +0 -0
  17. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/.ruff_cache/0.6.9/5647188018562798146 +0 -0
  18. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/.ruff_cache/0.6.9/9121026693023336299 +0 -0
  19. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/.ruff_cache/CACHEDIR.TAG +0 -0
  20. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/__init__.py +0 -0
  21. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/py.typed +0 -0
  22. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/utils/.ruff_cache/.gitignore +0 -0
  23. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/utils/.ruff_cache/0.14.6/15861910901900155226 +0 -0
  24. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/utils/.ruff_cache/0.14.6/7883837630368280160 +0 -0
  25. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/utils/.ruff_cache/CACHEDIR.TAG +0 -0
  26. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/utils/alias_map.py +0 -0
  27. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/utils/exceptions.py +0 -0
  28. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/utils/structlog.py +0 -0
  29. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/utils/type_utils.py +0 -0
  30. {graphty-0.3.0 → graphty-0.4.0}/src/graphty/utils/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: graphty
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Add your description here
5
5
  Author: Lukas Plank
6
6
  Author-email: Lukas Plank <lupl@tuta.io>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "graphty"
3
- version = "0.3.0"
3
+ version = "0.4.0"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -21,7 +21,7 @@ class ModelMaterializer[TModel: BaseModel]:
21
21
  @cached_property
22
22
  def df(self) -> pl.DataFrame:
23
23
  lazy_frame: pl.LazyFrame = self._planner.run()
24
- return lazy_frame.collect()
24
+ return lazy_frame.collect(engine="streaming")
25
25
 
26
26
  def generate_bindings(self) -> Iterator[dict[str, object]]:
27
27
  return self.df.iter_rows(named=True)
@@ -33,12 +33,12 @@ def get_model_projection(model: type[BaseModel], base_cols: set[str]) -> set[str
33
33
 
34
34
  def build_model_struct(model: type[BaseModel], base_cols: set[str]) -> pl.Struct:
35
35
  model_projection: set[str] = get_model_projection(model=model, base_cols=base_cols)
36
- exprs: chain[pl.Expr] = chain(
37
- [pl.col(member) for member in model_projection],
38
- Exprs(model=model, base_cols=base_cols),
39
- )
36
+ exprs: list[pl.Expr] = [
37
+ *[pl.col(member) for member in model_projection],
38
+ *Exprs(model=model, base_cols=base_cols),
39
+ ]
40
40
 
41
- return pl.struct(*exprs)
41
+ return pl.struct(exprs or base_cols)
42
42
 
43
43
 
44
44
  @overload
@@ -310,9 +310,14 @@ class LazyFramePlanner:
310
310
  )
311
311
 
312
312
  if group_by is None:
313
- return self.lazy_frame.with_columns(
314
- *Exprs(model=self.model, base_cols=self._base_cols)
315
- ).drop(self._base_cols.difference(model_projection))
313
+ if self.model.model_fields:
314
+ # TODO: when Opacity/planner disengagement is implemented, fields marked
315
+ # as Opaque should not count as "model fields" for this check — a model
316
+ # with only Opaque fields should also return the raw frame.
317
+ return self.lazy_frame.with_columns(
318
+ *Exprs(model=self.model, base_cols=self._base_cols)
319
+ ).drop(self._base_cols.difference(model_projection))
320
+ return self.lazy_frame
316
321
 
317
322
  return self.lazy_frame.group_by(group_by, maintain_order=True).agg(
318
323
  *[pl.col(col).first() for col in model_projection.difference({group_by})],
File without changes
File without changes
File without changes