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.
- {py2dag-0.3.10 → py2dag-0.3.12}/PKG-INFO +1 -1
- {py2dag-0.3.10 → py2dag-0.3.12}/py2dag/parser.py +8 -2
- {py2dag-0.3.10 → py2dag-0.3.12}/pyproject.toml +1 -1
- {py2dag-0.3.10 → py2dag-0.3.12}/LICENSE +0 -0
- {py2dag-0.3.10 → py2dag-0.3.12}/README.md +0 -0
- {py2dag-0.3.10 → py2dag-0.3.12}/py2dag/__init__.py +0 -0
- {py2dag-0.3.10 → py2dag-0.3.12}/py2dag/cli.py +0 -0
- {py2dag-0.3.10 → py2dag-0.3.12}/py2dag/colors.py +0 -0
- {py2dag-0.3.10 → py2dag-0.3.12}/py2dag/export_dagre.py +0 -0
- {py2dag-0.3.10 → py2dag-0.3.12}/py2dag/export_svg.py +0 -0
- {py2dag-0.3.10 → py2dag-0.3.12}/py2dag/pseudo.py +0 -0
@@ -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
|
-
|
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,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|