Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the deprecated log_xxx_metadata calls #27

Closed
wants to merge 3 commits into from
Closed

Conversation

bcdurak
Copy link
Contributor

@bcdurak bcdurak commented Nov 13, 2024

Summary by CodeRabbit

  • New Features

    • Updated the default branch for testing workflows to enhance the testing process.
  • Bug Fixes

    • Improved logging functionality in the data preprocessing and model evaluation processes for better tracking of metadata.
  • Refactor

    • Adjusted logging method names for clarity and consistency in the codebase.

@bcdurak bcdurak requested a review from avishniakov November 13, 2024 19:25
Copy link

coderabbitai bot commented Nov 13, 2024

Walkthrough

The changes in this pull request involve modifications to the workflow configuration and the logging mechanisms in two Python files. In the workflow file .github/workflows/ci.yml, the default value for the ref-zenml input parameter has been changed from 'develop' to 'feature/followup-run-metadata'. In the Python scripts data_preprocessor.py and model_evaluator.py, the logging function log_artifact_metadata has been renamed to log_metadata, affecting how metadata is logged during data preprocessing and model evaluation, respectively.

Changes

File Path Change Summary
.github/workflows/ci.yml Updated default value of ref-zenml input parameter from 'develop' to 'feature/followup-run-metadata'.
template/steps/data_preprocessor.py Changed import from log_artifact_metadata to log_metadata and updated logging at the end of the function.
template/steps/model_evaluator.py Renamed log_artifact_metadata to log_metadata and adjusted control flow for logging warnings.

Possibly related PRs

  • Remove .value from metadata access #25: The changes in this PR involve updating how metadata values are accessed, specifically the random_state and target, which aligns with the logging changes in the main PR that also deals with metadata handling in the workflow.

Suggested reviewers

  • schustmi
  • stefannica

Poem

🐇 In the meadow where we play,
Changes come, bright as day.
Logging now with clearer sight,
Preprocessing takes its flight.
Follow up with metadata,
Hops of joy, let’s celebrate-a! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 223516c and 52bf387.

📒 Files selected for processing (1)
  • template/steps/data_preprocessor.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • template/steps/data_preprocessor.py

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (1)
template/steps/model_evaluator.py (1)

Line range hint 65-80: Critical: Fix incorrect warning logic

There's a logical error in the warning implementation. Currently, warnings are only logged when the test accuracy meets the minimum requirement (due to the else block placement), which is opposite to the intended behavior described in the docstring.

Apply this fix to ensure warnings are logged when either accuracy is below minimum:

    messages = []
    if trn_acc < min_train_accuracy:
        messages.append(
            f"Train accuracy {trn_acc*100:.2f}% is below {min_train_accuracy*100:.2f}% !"
        )
    if tst_acc < min_test_accuracy:
        messages.append(
            f"Test accuracy {tst_acc*100:.2f}% is below {min_test_accuracy*100:.2f}% !"
        )
-    else:
-        for message in messages:
-            logger.warning(message)
+    for message in messages:
+        logger.warning(message)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a200a13 and 223516c.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • template/steps/data_preprocessor.py (2 hunks)
  • template/steps/model_evaluator.py (2 hunks)
🔇 Additional comments (4)
.github/workflows/ci.yml (1)

58-58: Verify the feature branch status and stability

Let's verify the existence and status of the feature branch being used.

✅ Verification successful

Based on the GitHub API results, I can now provide a final response since I have verified the status of the feature branch:

Feature branch is active and recently updated

The feature/followup-run-metadata branch exists and shows active development with the latest commit from November 13, 2024 (6f2e2245a). The branch has multiple recent commits indicating ongoing development and stability.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the status of the feature branch in ZenML repository

# Check if the branch exists and its latest commit
gh api \
  -H "Accept: application/vnd.github+json" \
  repos/zenml-io/zenml/branches/feature/followup-run-metadata

# Check recent commits to understand branch stability
gh api \
  -H "Accept: application/vnd.github+json" \
  repos/zenml-io/zenml/commits?sha=feature/followup-run-metadata&per_page=5

Length of output: 133965

template/steps/data_preprocessor.py (1)

10-10: LGTM: Import statement updated correctly

The change from log_artifact_metadata to log_metadata aligns with the PR objective to remove deprecated metadata logging calls.

template/steps/model_evaluator.py (2)

7-7: LGTM: Import updated to use new logging function

The change from log_artifact_metadata to log_metadata aligns with the PR objective of removing deprecated calls.


82-85: LGTM: Logging function updated while maintaining functionality

The change from log_artifact_metadata to log_metadata is correctly implemented, preserving the existing metadata structure and artifact naming.

.github/workflows/ci.yml Show resolved Hide resolved
template/steps/data_preprocessor.py Outdated Show resolved Hide resolved
@bcdurak bcdurak closed this Nov 28, 2024
@bcdurak bcdurak deleted the 2024.11.13 branch November 28, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants