-
Notifications
You must be signed in to change notification settings - Fork 443
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
Polymorthic run_metadata
#2064
Polymorthic run_metadata
#2064
Conversation
…ithub.com/zenml-io/zenml into feature/OSS-2574-polymorthic-run-metadata
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.
Nice, I left a few nitpicks but overall this looks good to merge already 🚀
src/zenml/zen_stores/migrations/versions/8ed03137cacc_polymorthic_run_metadata.py
Outdated
Show resolved
Hide resolved
src/zenml/zen_stores/migrations/versions/8ed03137cacc_polymorthic_run_metadata.py
Outdated
Show resolved
Hide resolved
src/zenml/zen_stores/migrations/versions/8ed03137cacc_polymorthic_run_metadata.py
Outdated
Show resolved
Hide resolved
src/zenml/zen_stores/migrations/versions/8ed03137cacc_polymorthic_run_metadata.py
Outdated
Show resolved
Hide resolved
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.
Great changes. It looks much cleaner now. Unfortunately, it has a few clashes with the PR here. As I mentioned in my notes, we have to coordinate our efforts here.
) | ||
step_run_id: Optional[UUID] = Field( | ||
title="The ID of the step run that this metadata belongs to." | ||
resource_id: UUID = Field( |
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.
It might be nice to put the resource_id
and the resource_type
into the body of the response as they are essential to a RunMetadataResponse
. WDYT?
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.
I disagree, in almost all cases you will access these models through the parent entity, e.g., artifact.run_metadata
/ ... in which case you already know what the resource type and ID are
step = zen_store().get_run_step(run_metadata.resource_id) | ||
verify_permission_for_model(step, action=Action.UPDATE) | ||
elif run_metadata == MetadataResourceTypes.ARTIFACT: | ||
artifact = zen_store().get_artifact(run_metadata.resource_id) |
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.
Again, I am leaving notes where the artifact version PR might affect the current implementation. You might have to get the artifact_version
first and then check for the artifact
within that response.
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.
artifact versions have their own RBAC entity so I don't think you need that
src/zenml/zen_stores/migrations/versions/8ed03137cacc_polymorthic_run_metadata.py
Show resolved
Hide resolved
@avishniakov @bcdurak since my PR caused all the conflicts and since I already reviewed this one, I already went ahead and resolved the merge conflicts between them. While at it, I also addressed the minor open reviewer requests. IMO this should be ready to merge now, @bcdurak WDYT? |
Describe changes
I reworked
run_metadata
table to acceptresource_id
andresoruce_type
as identifiers going forward, instead of growing number of columns we now add a new resource type and it would be done.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