Python SDK 42 fixes/improvements

Hi,

The new, version 42, of the python SDK includes a couple of great improvements however it feels like these changes have only been partially implemented and actually made the SDK more inconsistent in places.

No longer needing to manually handle the paging for list calls is great but what about search calls, and how about also fixing batch calls to batch internally?

Also only paged list calls return an iterable so customers.list() behaves differently to customers.search(...) and to locations.list().

Also now that calls raise an Exception on error why return the response object rather than just the object itself?

In short why not make the API..

customer = client.customers.get(...)

for location in client.locations.list(...):
   ....

for customer in client.customers.search(...):
   ....

for order in client.orders.batch_get(...):
   ....

Given the call signature and error handling semantics has changed for every call in the SDK with this release why not take the opportunity to make it consistent?

Furthermore, using pydantic models is great but the returned models all have mandatory fields such as id set as optional which just leads to lots of invalid type warnings in code that uses the data.

Will

We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slight_smile: