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

fix missing fields when ordering by #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

isinyaaa
Copy link

@isinyaaa isinyaaa commented Sep 5, 2024

Description

Related: kubeflow/model-registry#358

How Has This Been Tested?

Tested locally by deploying with kind. Attempted to order various context queries.

from model_registry import ModelRegistry
import contextlib

mr = ModelRegistry("http://localhost", 8080, author="me", is_secure=False)

with contextlib.suppress(Exception):
    mr.register_model(
        "model1",
        "s3",
        version="1",
        model_format_name="1",
        model_format_version="2",
    )
with contextlib.suppress(Exception):
    mr.register_model(
        "model",
        "s3",
        version="2",
        model_format_name="1",
        model_format_version="2",
    )
with contextlib.suppress(Exception):
    mr.register_model(
        "model",
        "s3",
        version="3",
        model_format_name="1",
        model_format_version="2",
    )
with contextlib.suppress(Exception):
    mr.register_model(
        "model2",
        "s3",
        version="1",
        model_format_name="1",
        model_format_version="2",
    )
with contextlib.suppress(Exception):
    mr.register_model(
        "model",
        "s3",
        version="1",
        model_format_name="1",
        model_format_version="2",
    )


print("Registered models by id")
for model in mr.get_registered_models().limit(1):
    print(model)

print("Registered models by create")
for model in mr.get_registered_models().order_by_creation_time().descending().limit(1):
    print(model)

print("Registered models by update")
for model in mr.get_registered_models().order_by_update_time().limit(1):
    print(model)


print("model versions by id")
for model in mr.get_model_versions("model").limit(1):
    print(model)

print("model versions by create")
for model in (
    mr.get_model_versions("model").order_by_creation_time().descending().limit(1)
):
    print(model)

print("model versions by update")
for model in mr.get_model_versions("model").order_by_update_time().limit(1):
    print(model)

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Copy link
Member

@tarilabs tarilabs left a comment

Choose a reason for hiding this comment

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

/lgtm

thanks @isinyaaa !

Would be awesome to consider how to run the tests always to ensure non-regressions (I'm not saying that has to be done as part of this PR)

@isinyaaa
Copy link
Author

@tarilabs updated the tag from "Fixes" to "Related", so the issue won't close automatically, wdyt? can we merge this?

@tarilabs
Copy link
Member

thanks @isinyaaa yes I believe keeping the link this way (related) is more appropriate.
once merged, kindly double-check if the steps in the productization process are followed automatically by devops, or further actions are needed, thanks!

@tarilabs
Copy link
Member

while we're not in "maintenance" of this image on behalf of other teams, is there any comments DSP @opendatahub-io/data-science-pipelines-maintainers wants to add wrt to this PR?

I can proceed to merge this PR and to my understanding it can be used by the manifests by referring to its main-xxxxxx tag (or sha, if preferred) but @isinyaaa this will still need to be followed-up with DevOps team for the downstream/product, as suggested in #12 (comment)

cc @rareddy
in case I misunderstood anything, kindly let me know!

@diegolovison
Copy link

Hi,

I think the commit message should be changed to address the change:
The current commit message: fix missing fields when ordering by
To something like: Adding the columns because of XYZ

This is going to give a notion of the change and the reason behind that.

Signed-off-by: Isabella Basso do Amaral <idoamara@redhat.com>
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.

3 participants