Skip to content

Commit

Permalink
This commit fixes a DAX translator error.
Browse files Browse the repository at this point in the history
Before this commit, it was assumed that each input data and command defined in `replica` and `transformations` files were used by the steps defined in the `workflow` file.
Now, it is checked if they are used, otherwise a warning log is shown and they are skipped.
  • Loading branch information
LanderOtto committed Dec 11, 2024
1 parent 875a1cd commit d7d234e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions swirlc/translator/dax_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Data,
)
from swirlc.core.translator import AbstractTranslator
from swirlc.log_handler import logger

MANDATORY_FILES = ("replicas", "sites", "transformations", "workflow")

Expand Down Expand Up @@ -238,6 +239,11 @@ def _translate(self) -> Workflow:
(physical_path["site"], physical_path["pfn"])
)
location_name = location_binding_dax_swirl[physical_path["site"]]
if replica["lfn"] not in data_binding_dax_swirl.keys():
logger.warning(
f"The input data `{replica['lfn']}` is not used by any step"
)
continue
data_name = data_binding_dax_swirl[replica["lfn"]]
if location_name in workflow.locations.keys():
workflow.locations[location_name].data[data_name] = Data(
Expand All @@ -249,6 +255,11 @@ def _translate(self) -> Workflow:
for transformation in transformations_config["transformations"]:
for binding in transformation["sites"]:
location_name = location_binding_dax_swirl[binding["name"]]
if transformation["name"] not in dax_step_name_id.keys():
logger.warning(
f"The command `{transformation['name']}` is not used by any step"
)
continue
for dax_step_id in dax_step_name_id[transformation["name"]]:
step_name = step_binding_dax_swirl[dax_step_id]
workflow.steps[step_name].command = binding["pfn"]
Expand Down

0 comments on commit d7d234e

Please sign in to comment.