-
Notifications
You must be signed in to change notification settings - Fork 26
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
Propagate tags from fw_spec to metadata #345
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #345 +/- ##
===========================================
- Coverage 100.00% 99.86% -0.14%
===========================================
Files 19 19
Lines 1430 1439 +9
Branches 361 364 +3
===========================================
+ Hits 1430 1437 +7
- Misses 0 1 +1
- Partials 0 1 +1
|
After speaking to @samblau, it seems that the functionality desired is to propagate the tags from the fw_spec into the metadata stored in the document. While the documentation recommends to use |
…ng is required git push
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 for this. I just had one minor comment.
src/jobflow/managers/fireworks.py
Outdated
# Add the metadata from the fw_spec | ||
fw_tags = fw_spec.get("tags", None) | ||
if fw_tags is not None: | ||
job.metadata.update({"tags": fw_tags}) |
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.
Maybe we should also check if tags already exist and if they are a list, and in that case append the tags?
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.
Alright. Added.
One small issue I encountered here was that tags were getting duplicated if the job metadata had the "tags" key in it. Because of this line: spec.update(job.metadata) # add metadata to spec.
To account for this, I just removed all duplicates from job.metadata["tags"]
assuming that duplicates will never be desired.
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.
That's a good catch. Thanks!
Picking up #320.
I think the changed originally proposed would add alot of redundant information into the document/db.