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

Rename log_model_version_metadata to log_model_metadata #2215

Merged
merged 4 commits into from
Jan 4, 2024

Conversation

htahir1
Copy link
Contributor

@htahir1 htahir1 commented Jan 3, 2024

Describe changes

I Renamed log_model_version_metadata to log_model_metadata to make it more consistent with log_artifact_metadata + i made it part of the public api so you can import it like;

from zenml import log_model_metadata

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • If my change requires a change to docs, I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have based my new branch on develop and the open PR is targeting develop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.
  • If my changes require changes to the dashboard, these changes are communicated/requested.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

Summary by CodeRabbit

  • New Features

    • Introduced log_model_metadata function for enhanced model metadata logging.
  • Deprecated

    • Deprecated log_model_version_metadata in favor of the new logging function.
  • Enhancements

    • The new logging function now optionally accepts model version and supports a broader range of types.
  • Error Handling

    • Added error checks to ensure model name/version is provided when necessary.
  • Tests

    • Updated integration tests to reflect the new function naming and behavior.

@htahir1 htahir1 requested a review from bcdurak January 3, 2024 12:42
Copy link
Contributor

coderabbitai bot commented Jan 3, 2024

Important

Auto Review Skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Walkthrough

ZenML has introduced a new function log_model_metadata to handle model metadata logging, replacing the older log_model_version_metadata. The updated function features an optional and more flexible model_version parameter. It enforces a requirement to provide a model name/version unless used within a step that has a model_version configured via a decorator. This change streamlines the process and ensures that model metadata is consistently logged, while improving error handling.

Changes

File Path Change Summary
src/zenml/.../__init__.py Added log_model_metadata function.
src/zenml/.../utils.py Deprecated log_model_version_metadata and introduced log_model_metadata with an optional model_version parameter. Added ValueError for missing name/version.
tests/integration/functional/model/.../test_model_version.py Renamed log_model_version_metadata to log_model_metadata and updated related function calls and imports.

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 with CodeRabbit Bot (@coderabbitai)

  • You can directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging @coderabbitai in a comment. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate README in the markdown format.

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.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@github-actions github-actions bot added internal To filter out internal PRs and issues enhancement New feature or request labels Jan 3, 2024
Copy link
Contributor

@bcdurak bcdurak left a comment

Choose a reason for hiding this comment

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

LGTM! 🦭

@htahir1
Copy link
Contributor Author

htahir1 commented Jan 3, 2024

@coderabbitai review

@htahir1 htahir1 requested review from schustmi and strickvl January 3, 2024 12:53
Copy link
Contributor

@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.

Review Status

Actionable comments generated: 0

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 79d967e and 83da246.
Files selected for processing (3)
  • src/zenml/init.py (2 hunks)
  • src/zenml/model/utils.py (1 hunks)
  • tests/integration/functional/model/test_model_version.py (3 hunks)
Files skipped from review due to trivial changes (1)
  • tests/integration/functional/model/test_model_version.py
Additional comments: 6
src/zenml/__init__.py (2)
  • 45-45: The import statement for log_model_metadata has been added correctly.

  • 61-61: The addition of log_model_metadata to the __all__ list is correct, making it part of the public API.

src/zenml/model/utils.py (4)
  • 141-147: The deprecation warning for log_model_version_metadata is clear and the function now proxies to log_model_metadata.

  • 150-154: The signature of log_model_metadata correctly makes the model_version parameter optional, aligning with the PR objectives.

  • 154-158: The error handling in log_model_metadata to raise a ValueError when required parameters are missing is implemented correctly.

  • 125-161: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [158-174]

The logic to use the model version from the step context if available in log_model_metadata is correct.

Copy link
Contributor

@strickvl strickvl left a comment

Choose a reason for hiding this comment

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

LGTM, pending tests passing. I also added it to our deprecations list for tracking.

@htahir1 htahir1 merged commit 14fc0b8 into develop Jan 4, 2024
31 of 33 checks passed
@htahir1 htahir1 deleted the feature/rename-log-model-version-to-model branch January 4, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internal To filter out internal PRs and issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants