Skip to content

Commit

Permalink
Also fix output path from step
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudw committed Sep 26, 2024
1 parent 1cdc8d9 commit 2afb9a6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions metaflow/plugins/aip/aip_metaflow_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,15 @@ def _write_card_artifacts(
cards, key=lambda card: (card.type != "default", cards.index(card))
)

i = 0
pathlib.Path("/tmp/outputs/cards/").mkdir(parents=True, exist_ok=True)
for card in sorted_cards:
iter_name = "" if i == 0 else i
file_name = f"/tmp/outputs/cards/card{iter_name}.html"
for index, card in enumerate(sorted_cards):
file_name = f"/tmp/outputs/cards/card{index}.html"
try:
with open(file_name, "w") as card_file:
card_file.write(card.get())
except Exception:
logging.error(f"Failed to write card {i} of type {card.type}")
logging.error(f"Failed to write card {index} of type {card.type}")
raise
i = i + 1


def _step_cli(
Expand Down

0 comments on commit 2afb9a6

Please sign in to comment.