Closed nutjob4life closed 3 years ago
@nutjob4life would this work with the previous implementation of the API as well? That is the way the response format should be, so as long as it works for both, we should be ok.
would this work with the previous implementation of the API as well? That is the way the response format should be, so as long as it works for both, we should be ok.
@jordanpadams no, it won't.
Some would say it's the job pds-api-client to provide a uniform/stable interface to application programmers regardless of what comes across the wire, though 🤔
@nutjob4life copy. then please revert the changes to support the new "values" dict. that should not be there and is a regression to the API. one of the fun parts of working from a beta version of an API without a robust regression suite :-)
@jordanpadams okay, reverted 😉
@nutjob4life do we still need --disable-pagination-workaround
?
@nutjob4life do we still need --disable-pagination-workaround?
@jordanpadams that's covered by #107
@jordanpadams good catch on the Versioneer stuff in setup.cfg
🍻
📜 Summary
Merge this to resolve #106 but also work around additional changes to the server's delivery of data to the client.
See, previously, using pds.api_client (versions 0.4.0 and 0.5.0), you'd get theproperties
attribute of thepds.api_client.models.Product
class with key-value pairs like this:Something changed, and rather thanpds.api_client
shielding its users from that change, it passes the change onto them 😮The new
properties
attribute is no longer a list of values, but a dict with a singlevalues
element with a list ofvalues
:So to make sure the fix to #106 actually worked, this PR also absorbs and deals with the change in data coming from the API server.Update: now the server always gives sequences of values for properties but without the single-item dictionary with a
values
key—even for those which are semantically singly-valued, like label file MD5. Also, this works around PDS API Client stealing thepds
package name and preventing dependent code from being found.🩺 Test Data and/or Report
🧩 Related Issues
106