Update Python tools
This commit is contained in:
@@ -144,8 +144,14 @@ class TaskCatalog:
|
||||
group_path,
|
||||
{path.name for path in task_paths},
|
||||
)
|
||||
paths_by_filename = {path.name: path for path in task_paths}
|
||||
ordered_filenames = [
|
||||
*declarations_by_filename,
|
||||
*(path.name for path in task_paths if path.name not in declarations_by_filename),
|
||||
]
|
||||
tasks = []
|
||||
for path in task_paths:
|
||||
for filename in ordered_filenames:
|
||||
path = paths_by_filename[filename]
|
||||
declaration = declarations_by_filename.get(path.name)
|
||||
tasks.append(
|
||||
Task(
|
||||
@@ -289,11 +295,10 @@ def parse_task_declaration(
|
||||
) -> TaskDeclaration:
|
||||
if (
|
||||
not isinstance(declaration, dict)
|
||||
or not {"inputs"} <= set(declaration)
|
||||
or set(declaration) - {"inputs", "wait_for_result", "download_artifacts"}
|
||||
):
|
||||
raise ValueError(f"{manifest_path} task {filename} has an invalid declaration.")
|
||||
raw_inputs = declaration["inputs"]
|
||||
raw_inputs = declaration.get("inputs", [])
|
||||
if not isinstance(raw_inputs, list):
|
||||
raise ValueError(f"{manifest_path} task {filename} inputs must be a list.")
|
||||
fields = tuple(parse_input_field(manifest_path, filename, raw) for raw in raw_inputs)
|
||||
|
||||
Reference in New Issue
Block a user