gtalarico / pyairtable

Python Api Client for Airtable
https://pyairtable.readthedocs.io
MIT License
786 stars 139 forks source link

Fix return_fields_by_field_id on create/update, and add more tests #252

Closed mesozoic closed 1 year ago

mesozoic commented 1 year ago

The reason this wasn't working before was that we were passing returnFieldsByFieldId as a query parameter, when we really needed to include it in the JSON payload in the POST body. This branch fixes that, adds some tests, and does a bit of tidying around the integration test suite.

On further digging, it doesn't look like Create records or Update records support any of the options (besides this one) which we can pass to List records, so I removed the **options kwargs from those method signatures.

Fixes #194

codecov-commenter commented 1 year ago

Codecov Report

Merging #252 (2ef7bac) into main (b06baa6) will not change coverage. The diff coverage is 70.00%.

@@           Coverage Diff           @@
##             main     #252   +/-   ##
=======================================
  Coverage   87.61%   87.61%           
=======================================
  Files          14       14           
  Lines         662      662           
=======================================
  Hits          580      580           
  Misses         82       82           
Impacted Files Coverage Δ
pyairtable/api/abstract.py 100.00% <ø> (ø)
pyairtable/api/api.py 78.94% <50.00%> (ø)
pyairtable/api/base.py 78.37% <66.66%> (ø)
pyairtable/api/table.py 100.00% <100.00%> (ø)
mesozoic commented 1 year ago

return_fields_by_field_id= is a mouthful, and I'd probably have picked something more concise (like field_ids=). But I left it alone because I didn't want to break any code that already uses the existing parameter.

mesozoic commented 1 year ago

Gonna merge now. If anyone spots a problem or wants to reopen a decision in here, just tag me and we'll talk it through.