-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add SetTag endpoint #10
Conversation
Signed-off-by: Juan Escalada <[email protected]>
Looks like I messed up the line endings, will fix in a sec! |
It feels like you need to re generate mocks. |
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.
Hi @jescalada, thanks for this contribution!
There are some interesting changes in here which I did not expect.
It would be great to jump on a call sometime and further discuss.
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
I managed to get the Is this meant to be used in our own Go tests? I noticed that for the |
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.
FAILED .mlflow.repo/tests/store/tracking/test_sqlalchemy_store.py::test_set_tag
is failing because the test uses monkeypatch.setenv("MLFLOW_TRUNCATE_LONG_VALUES", "true")
.
@dsuhinin can you give some advice on what should be done in this case.
Oh and please rebase on latest main. |
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
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.
Thanks!
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 looks good! Left few minor questions/proposals.
def test_set_tag(store: SqlAlchemyStore, monkeypatch): | ||
() | ||
|
||
|
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.
So, can we try to have not just an empty test in that case but something like:
run = _run_factory(store)
tkey = "test tag"
tval = "a boogie"
new_val = "new val"
tag = entities.RunTag(tkey, tval)
new_tag = entities.RunTag(tkey, new_val)
store.set_tag(run.info.run_id, tag)
# Overwriting tags is allowed
store.set_tag(run.info.run_id, new_tag)
# test setting tags that are too long fails.
monkeypatch.setenv("MLFLOW_TRUNCATE_LONG_VALUES", "false")
with pytest.raises(
MlflowException, match=f"exceeds the maximum length of {MAX_TAG_VAL_LENGTH} characters"
):
store.set_tag(
run.info.run_id, entities.RunTag("longTagKey", "a" * (MAX_TAG_VAL_LENGTH + 1))
)
# test can set tags that are somewhat long
store.set_tag(run.info.run_id, entities.RunTag("longTagKey", "a" * (MAX_TAG_VAL_LENGTH - 1)))
run = store.get_run(run.info.run_id)
assert tkey in run.data.tags
assert run.data.tags[tkey] == new_val
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.
so without such part which actually failing:
monkeypatch.setenv("MLFLOW_TRUNCATE_LONG_VALUES", "true")
store.set_tag(run.info.run_id, entities.RunTag("longTagKey", "a" * (MAX_TAG_VAL_LENGTH + 1)))
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.
@dsuhinin I just tried implementing this, and it seems to require a lot of test-specific dependencies from the MLflow side. For example, the _run_factory
function makes use of another helper function _create_experiments
and so on, which would clutter our tests if we ported them over. And they are private so I don't think we have a choice other than to implement them directly on our override_test_sqlalchemy_store.py
. I feel that implementing these would clutter that file too much, maybe we could have another file for test utils? 🤔 At any rate, I feel that it would be a pretty large change so we could make a separate issue/PR to sort it out!
Edit: I made an issue for it so that we don't forget: #69
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: Juan Escalada <[email protected]>
Signed-off-by: nojaf <[email protected]>
PR for adding the
SetTag
endpoint. I also added theDeleteTag
endpoint from #8.There are various new tests, all of which are passing except one:
test_set_tag_with_empty_string_as_value[sqlalchemy]
test_set_tag_validation[sqlalchemy]
test_set_tag_truncate_too_long_tag
test_update_run_name
test_update_run_name_without_changing_status[sqlalchemy]
test_set_tag
The reason why
test_set_tag
is failing, is that it usesmonkeypatch
to set an env, which doesn't flow to the Go side in our implementation. I have temporarily disabled that specific test by adding it toconftest.py
until we can find a solution for similar tests.I also added a
test:PythonSpecific
command for testing a single endpoint at a time.