-
Notifications
You must be signed in to change notification settings - Fork 415
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
Update has_custom_name
for legacy artifacts
#2384
Update has_custom_name
for legacy artifacts
#2384
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the WalkthroughThe updates involve adding functionality to handle artifacts with custom names in the ZenML framework. Specifically, these changes allow for the checking and updating of a custom name status for artifacts. This is achieved through modifications in utility functions, client methods, and schema conditions, ensuring that the system can recognize and process artifacts that have been assigned custom names. Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No way to test this without triggering a migration, right?
Otherwise LGTM.
There was a problem hiding this 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
Files selected for processing (4)
- src/zenml/artifacts/utils.py (1 hunks)
- src/zenml/client.py (3 hunks)
- src/zenml/models/v2/core/artifact.py (1 hunks)
- src/zenml/zen_stores/schemas/artifact_schemas.py (1 hunks)
Additional comments: 4
src/zenml/models/v2/core/artifact.py (1)
- 58-58: The addition of the
has_custom_name
field to theArtifactUpdate
class is correctly implemented, following the optional field pattern with a default value ofNone
. This allows for flexibility in updating artifacts, making it possible to specify or omit the custom name status during updates.src/zenml/zen_stores/schemas/artifact_schemas.py (1)
- 146-147: The logic to update the
has_custom_name
attribute in theArtifactSchema
class based on theartifact_update
parameter is correctly implemented. This ensures that thehas_custom_name
status can be dynamically updated, reflecting the current state accurately.src/zenml/artifacts/utils.py (1)
- 192-195: The conditional check and update logic for the artifact's custom name status within the
save_artifact
function is correctly implemented. This ensures that if there's a discrepancy between the artifact's currenthas_custom_name
status and the provided status, it will be updated accordingly. This is a crucial step for maintaining consistency in artifact metadata.src/zenml/client.py (1)
- 2770-2776: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [2764-2783]
The addition of the
has_custom_name
parameter to theupdate_artifact
method inclient.py
is a significant change. This parameter allows specifying whether the artifact has a custom name, which is crucial for handling legacy artifacts correctly after the introduction of Artifacts Versioning in ZenML. This change directly addresses the issue with thehas_custom_name
field for legacy artifacts, ensuring that the field is accurately set and updated according to runtime values. The implementation appears correct and aligns with the PR's objectives to fix the issue with legacy artifacts'has_custom_name
field.
I think I can write a test for it, let me try. |
…or-legacy-artifacts
…or-legacy-artifacts
…facts' of https://github.com/zenml-io/zenml into bugfix/OSSK-391-has-custom-name-not-set-for-legacy-artifacts
…or-legacy-artifacts
* update `has_custom_name` for legacy artifacts * add test * handle special characters in artifact names * update test signature * update test signature --------- Co-authored-by: Safoine El Khabich <34200873+safoinme@users.noreply.github.com>
* update `has_custom_name` for legacy artifacts * add test * handle special characters in artifact names * update test signature * update test signature --------- Co-authored-by: Safoine El Khabich <34200873+safoinme@users.noreply.github.com>
Describe changes
I fixed the
has_custom_name
field for artifacts created before the introduction of Artifacts Versioning. For those nohas_custom_name
value was set during migration, and at the current point, it is not possible to identify which artifact should have the flag based on pure data, so the fix is updating the artifact, ifhas_custom_name
diverges from what is given in the runtime.Pre-requisites
Please ensure you have done the following:
develop
and the open PR is targetingdevelop
. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes
Summary by CodeRabbit