Skip to content

Commit

Permalink
fix: improve output msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
ijdoc committed Oct 9, 2024
1 parent 1643825 commit 98919d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion batch/batch_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def main(args):
)
artifact = run.log_artifact(artifact).wait()
print(
f"New `{batch_type}` batch logged as `{artifact.source_name}`.\n"
f"Executed [run]({run.url}) to log new `{batch_type}` batch as `{artifact.source_name}`.\n"
f"- Iteration: {iteration}\n"
f"- Iteration Stride: {stride_days} day(s)\n"
f"- Total length: {history_days} day(s)"
Expand Down
14 changes: 6 additions & 8 deletions drift/check_drift.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,12 @@
artifact = run.log_artifact(artifact).wait()
# Open a github issue asking for manual review
issue_title = f"Data drift detected on {train_artifact.source_name}"
drifted_features = ", ".join(
[feature for feature, drift in drift_results.items() if drift]
)
issue_body = (
f"Drift has been detected in the following features: {drifted_features}.\n\n"
f"Please review the [logged artifact](https://wandb.ai//{run.entity}/{run.project}/artifacts/{artifact.type}/{artifact.source_name}) "
f"and the [drift report]({report_url}) to determine if the training data should be updated.\n\n"
f"If approved, link the [logged artifact](https://wandb.ai//{run.entity}/{run.project}/artifacts/{artifact.type}/{artifact.source_name}) "
f"to the training Registry (`jdoc-org/wandb-registry-dataset/training`), otherwise, close this issue."
f"Data drift has been detected when comparing the registered training dataset with recent production data.\n\n"
f"Please review the [candidate artifact](https://wandb.ai/{run.entity}/{run.project}/artifacts/{artifact.type}/{artifact.source_name}) "
f"and the [drift report]({report_url}) to determine if the registered training data should be updated.\n\n"
f"To approve the new candidate after review, link it to [the training Dataset Registry](https://wandb.ai/registry/dataset?selectionPath=jdoc-org%2Fwandb-registry-dataset%2Ftraining&view=versions) at "
f"(`jdoc-org/wandb-registry-dataset/training`), otherwise close this issue."
)
issue_url = open_github_issue(issue_title, issue_body, labels=["drift", "data"])
print(
Expand All @@ -93,6 +90,7 @@
else:
print("> No drift detected.\n")

print(f"- [W&B Run]({run.url})")
print(f"- [Full data drift report]({report_url})")

# Optionally the drift detection result in a parseable format.
Expand Down

0 comments on commit 98919d2

Please sign in to comment.