model-registry icon indicating copy to clipboard operation
model-registry copied to clipboard

Context name containing characters requiring url quoting/escaping

Open tarilabs opened this issue 1 year ago • 0 comments

Describe the bug Unable to index ModelVersion containing :.

To Reproduce Steps to reproduce the behavior:

  1. attempt to index a ModelVersion for "some:version"

following the kubeflow tutorial, example: ,

rm = registry.register_model(
    "mnist",
    "https://github.com/tarilabs/demo20231212/raw/main/v1.nb20231206162408/mnist.onnx",
    model_format_name="onnx",
    model_format_version="1",
    version="some:version",    # <-- here
    description="lorem ipsum mnist",
    metadata={
        "accuracy": 3.14,
        "license": "apache-2.0",
    }
)

Expected behavior Can use special characters without having to urllib.parse.quote() manually the version name.

i.e. without requiring to:

from urllib.parse import quote
# ...
    version=quote("some:version"),   

Additional context This is likely deriving from the fact that in the Model Registry Python client, the logical model entity attributes are passed to the rest layer without quote where sometimes might be necessary; for example, when the model version name is used as a query parameter in a rest endpoint call.

It could be a helpful exercise to check if any limitations on MLMD side for Context names themselves (we are aware MLMD Context names are not updatable, but that is an unrelated limitation).

tarilabs avatar Aug 11 '24 13:08 tarilabs