gtalarico / pyairtable

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

Return `""` and `False` from TextField, CheckboxField #347

Closed mesozoic closed 6 months ago

mesozoic commented 6 months ago

It doesn't really make sense for a TextField or CheckboxField to return None, since Airtable will return null for a text field with an empty value or a checkbox field that is unchecked. This branch allows those fields to return empty strings or False as their "missing value", which will reduce the amount of defensive if model.field is None: ... style of type checking required by implementers.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (7e7c853) to head (ab13ce5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #347 +/- ## =========================================== + Coverage 99.95% 100.00% +0.04% =========================================== Files 25 25 Lines 2307 2313 +6 =========================================== + Hits 2306 2313 +7 + Misses 1 0 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mesozoic commented 6 months ago

Adding to 3.0 milestone since this would technically be a breaking API change