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

Document how to set tags when creating an experiment #50

Open
vonpetersenn opened this issue Jun 4, 2024 · 3 comments
Open

Document how to set tags when creating an experiment #50

vonpetersenn opened this issue Jun 4, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@vonpetersenn
Copy link
Contributor

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\"}}" )

@vonpetersenn
Copy link
Contributor Author

Ok, I found the solution in issue "Improve tag definition #30"

The correct way to set tags would habe been [Dict("key" => "tag1", "value" => "tag1value")]

This should be documented somewhere.

@ablaom
Copy link
Member

ablaom commented Jun 5, 2024

@vonpetersenn Thanks for flagging this source of confusion. Updated the title of this post accordingly and re-opened.

@ablaom ablaom reopened this Jun 5, 2024
@ablaom ablaom changed the title setting tags when creating an experiment Document how to set tags when creating an experiment Jun 5, 2024
@ablaom ablaom added the documentation Improvements or additions to documentation label Jun 5, 2024
@vonpetersenn
Copy link
Contributor Author

@ablaom I have opened a pull request with updated documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants