py2dag 0.1.12__py3-none-any.whl → 0.1.13__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.
- py2dag/parser.py +13 -5
- {py2dag-0.1.12.dist-info → py2dag-0.1.13.dist-info}/METADATA +1 -1
- {py2dag-0.1.12.dist-info → py2dag-0.1.13.dist-info}/RECORD +6 -6
- {py2dag-0.1.12.dist-info → py2dag-0.1.13.dist-info}/LICENSE +0 -0
- {py2dag-0.1.12.dist-info → py2dag-0.1.13.dist-info}/WHEEL +0 -0
- {py2dag-0.1.12.dist-info → py2dag-0.1.13.dist-info}/entry_points.txt +0 -0
py2dag/parser.py
CHANGED
@@ -66,11 +66,19 @@ def parse(source: str, function_name: Optional[str] = None) -> Dict[str, Any]:
|
|
66
66
|
|
67
67
|
deps: List[str] = []
|
68
68
|
for arg in value.args:
|
69
|
-
if
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
if isinstance(arg, ast.Name):
|
70
|
+
if arg.id not in defined:
|
71
|
+
raise DSLParseError(f"Undefined dependency: {arg.id}")
|
72
|
+
deps.append(arg.id)
|
73
|
+
elif isinstance(arg, (ast.List, ast.Tuple)):
|
74
|
+
for elt in arg.elts:
|
75
|
+
if not isinstance(elt, ast.Name):
|
76
|
+
raise DSLParseError("List/Tuple positional args must be variable names")
|
77
|
+
if elt.id not in defined:
|
78
|
+
raise DSLParseError(f"Undefined dependency: {elt.id}")
|
79
|
+
deps.append(elt.id)
|
80
|
+
else:
|
81
|
+
raise DSLParseError("Positional args must be variable names or lists/tuples of names")
|
74
82
|
|
75
83
|
kwargs: Dict[str, Any] = {}
|
76
84
|
for kw in value.keywords:
|
@@ -2,10 +2,10 @@ py2dag/__init__.py,sha256=i8VB44JCVcRJAcvnQtbH8YVRUz5j7dE355iRbikXPGQ,250
|
|
2
2
|
py2dag/cli.py,sha256=BCBi5mNxOqeEN8uEMt_hiDx0iSt7ZE3y74cGXREzZ2I,1296
|
3
3
|
py2dag/export_dagre.py,sha256=S244wUxBMuM9qXD8bklaslkMp3rcbBGWvMhwWVBzBF0,3487
|
4
4
|
py2dag/export_svg.py,sha256=YyjqOuj8GhUTDWP70SKnnSWAKI1PvJwyOhHLwB29uNM,1812
|
5
|
-
py2dag/parser.py,sha256=
|
5
|
+
py2dag/parser.py,sha256=AdC76fKiLojxrc7Tk20CHgS7U0ofQwBYecMHQycc3PQ,11507
|
6
6
|
py2dag/pseudo.py,sha256=NJK61slyFLtSjhj8gJDJneUInEpBN57_41g8IfHNPWI,922
|
7
|
-
py2dag-0.1.
|
8
|
-
py2dag-0.1.
|
9
|
-
py2dag-0.1.
|
10
|
-
py2dag-0.1.
|
11
|
-
py2dag-0.1.
|
7
|
+
py2dag-0.1.13.dist-info/LICENSE,sha256=3Qee1EPwej_nusovTbyIQ8LvD2rXHdM0c6LNwk_D8Kc,1067
|
8
|
+
py2dag-0.1.13.dist-info/METADATA,sha256=gG64U7iwhT-lWu84Tu9c9TFTID6jIBHHI184tGXpkqY,3550
|
9
|
+
py2dag-0.1.13.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
10
|
+
py2dag-0.1.13.dist-info/entry_points.txt,sha256=Q0SHexJJ0z1te4AYL1xTZogx5FrxCCE1ZJ5qntkFMZs,42
|
11
|
+
py2dag-0.1.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|