-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[24.0] Fix datasets API custom keys encoding #17793
[24.0] Fix datasets API custom keys encoding #17793
Conversation
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.
I think that's the right thing to do!
All fields need to be explicitly declared now for HDA and HDCA responses.
Whenever we return AnyHistoryContentItem.
8f8865f
to
68a030c
Compare
I hit a bit of a roadblock with those "metadata_*" dynamic fields... I've been trying to find a clever solution but to no avail, so I will have to resort back to "extra=allow" for custom HDAs... 😞 |
Follow up to galaxyproject#15505 that was missing this change.
This time for those endpoints returning HistoryContentsResult
Since the visualizations are not strictly part of the detailed view definition.
As those are dynamic and associated with particular datatypes and not common to all HDAs.
Unfortunately there is no easy way to deal with the dynamic `metadata_*` fields so we need to resort back to this configuration until we can find a better solution for those.
using partial_model is still a big improvement ... in hindsight it'd have been clever to at least place the arbitrary metadata attributes under a common |
That is exactly what I thought... is it too late to change it? I know it will be a breaking change... but having a simple: metadata: Optional[Dict[str, Any]] would certainly make everything cleaner and "easier to discover and handle" for clients. |
We could think about it for dev, but I worry that there might be scripts out there that expect stuff like |
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.
Do you want to add a test maybe making sure that the dataset id is not an integer ?
Yes, I'm still working on the tests, I wanted to figure out the HDCA's views and modify the models and tests accordingly. |
OK, I found out that collection serialization does not follow the same patterns as datasets, for example, the "serialization_params" are ignored, and only the
UpdateThe serialization behavior also depends on the endpoint we are hitting... there are differences between the "show" and the "index" endpoints when listing the contents of a history it will handle the serialization differently depending on the
|
Since getting specific keys from an HDCA seems not implemented yet.
OK, if all tests pass now, it should be ready for review. There were some missing fields in some of the models. I tried to be very careful not to miss anything, but it is hard to tell. It would be great to devise a plan to make all the serialization process more homogeneous. |
@@ -116,6 +116,15 @@ class DatasetCollectionPopulatedState(str, Enum): | |||
FAILED = "failed" # some problem populating state, won't be populated | |||
|
|||
|
|||
class HashFunctionNames(str, Enum): |
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.
This has to be duplicated for now since I couldn't find any common place to put the definition. The other enum is in lib/galaxy/util/hash_util.py
Thanks for cleaning this up @davelopez! |
Requires #17779
Fixes #17729 since the custom keys will be serialized correctly after this.
This is similar to #17779 but this time addressing history contents.
TODO
view
andkeys
query parameters for HDAs and HDCAs.How to test the changes?
(Select all options that apply)
License