Skip to content

Commit

Permalink
fix(CsvCallback): error on duplicate stage names
Browse files Browse the repository at this point in the history
  • Loading branch information
sehoffmann committed Jan 5, 2025
1 parent bd89dc2 commit 70050e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dmlcloud/core/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,14 @@ def csv_path(self, stage: 'Stage'):
Returns:
Path: The complete path to the CSV file.
"""

if self.append_stage_name:
return self.path / f'metrics_{stage.name}.csv'
duplicate_stages = [s for s in stage.pipe.stages if s.name == stage.name]
idx = duplicate_stages.index(stage)
if len(duplicate_stages) > 1:
return self.path / f'metrics_{stage.name}_{idx + 1}.csv'
else:
return self.path / f'metrics_{stage.name}.csv'
else:
return self.path

Expand Down

0 comments on commit 70050e0

Please sign in to comment.