Skip to content

Document how to set tags when creating an experiment #50

@vonpetersenn

Description

@vonpetersenn

Hello,

I have trouble setting tags for an experiment.

On the code

###
#header
###

mlf = MLFlow("http://localhost:5000//api")

experiment_name = "tag_run"
experiment_tags = Dict("tag1" => "tag1value")

createexperiment(mlf; name=experiment_name, tags = experiment_tags)

I get a HTTP 400 error :

HTTP/1.1 400 Bad Request
Server: gunicorn
Date: Tue, 04 Jun 2024 10:26:14 GMT
Connection: close
Content-Type: application/json
Content-Length: 218

while

###
#header
###

mlf = MLFlow("http://localhost:5000//api")

experiment_name = "tag_run"

createexperiment(mlf; name=experiment_name)

runs as expected.

I tried to understand the problem a little bit but I don't think I quite understand it.
The createexperiment function parses the Dictionary as an argument to mlfpost which itself creates a body = JSON.json(kwargs)
So the HTTP request should read something like:

HTTP.post(apiuri, apiheaders, body) = HTTP.post( apiuri, apiheads, "{\"tags\":{\"tag1\":\"tag1value\"}}" )

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions