py2dag 0.3.10__tar.gz → 0.3.12__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: py2dag
3
- Version: 0.3.10
3
+ Version: 0.3.12
4
4
  Summary: Convert Python function plans to DAG (JSON, pseudo, optional SVG).
5
5
  License: MIT
6
6
  Author: rvergis
@@ -298,8 +298,14 @@ def parse(source: str, function_name: Optional[str] = None) -> Dict[str, Any]:
298
298
  tmp_id = _emit_assign_from_call(f"{var_name}_field", v_node)
299
299
  deps.append(tmp_id)
300
300
  else:
301
- # Synthesize const for literal value
302
- lit_val = _literal(v_node)
301
+ # Synthesize const for literal or arbitrary expression value
302
+ try:
303
+ lit_val = _literal(v_node)
304
+ except DSLParseError:
305
+ try:
306
+ lit_val = ast.unparse(v_node) # type: ignore[attr-defined]
307
+ except Exception:
308
+ lit_val = v_node.__class__.__name__
303
309
  tmp = _ssa_new(f"{var_name}_lit")
304
310
  ops.append({
305
311
  "id": tmp,
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "py2dag"
7
- version = "0.3.10"
7
+ version = "0.3.12"
8
8
  description = "Convert Python function plans to DAG (JSON, pseudo, optional SVG)."
9
9
  authors = ["rvergis"]
10
10
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes