Skip to content

Commit

Permalink
rename and change banner approach
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Jan 7, 2025
1 parent 87a3a0c commit 94750dd
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions scripts/fetch_last_known_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,18 @@ def main(args):
logging.info(
f"Looking for last recorded UDF '{target_udf}' of {'input' if no_outputs else 'output'} artifact '{target_artifact.name}'..."
)
udf_value, udf_history = udf_tools.fetch_last(
udf_value, traceback = udf_tools.fetch_last(
target_art=target_artifact,
target_udfs=target_udf,
log_traceback=True,
return_traceback=True,
on_fail=None,
)

steps_used.append(udf_history[-1]["Artifact"]["Parent Step"]["Name"])
steps_used.append(
f"'{traceback[-1]['Artifact']['Parent Step']['Name']}'"
+ f" ({traceback[-1]['Artifact']['Parent Step']['ID']})"
)

if udf_value is not None:
target_artifact.udf[target_udf] = udf_value
Expand All @@ -85,10 +88,11 @@ def main(args):
logging.warning(
f"Could not traceback UDF '{target_udf}' for {'input' if no_outputs else 'output'} artifact '{target_artifact.name}'"
)
logging.info(f"Traceback:\n{udf_history}")
logging.info(f"Traceback:\n{traceback}")

# TODO use variable
msg = f"UDF '{target_udf}' pulled from steps: {' ,'.join(set(steps_used))}. Please double check the values."
logging.warning(
f"UDF '{target_udf}' pulled from steps: {' ,'.join(set(steps_used))}. Please double check the values."
)


if __name__ == "__main__":
Expand Down

0 comments on commit 94750dd

Please sign in to comment.