gtalarico / pyairtable

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

Add formulas for missing logical operators #323

Closed MichalKacprzak99 closed 10 months ago

MichalKacprzak99 commented 11 months ago

Implements missing formulas from section "Logical operators and functions" from documentation of "Formula field reference". Currently only EQUAL is implemented.

codecov[bot] commented 10 months ago

Codecov Report

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

Comparison is base (e62a24e) 99.60% compared to head (65d579c) 99.61%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #323 +/- ## ======================================= Coverage 99.60% 99.61% ======================================= Files 24 24 Lines 1791 1801 +10 ======================================= + Hits 1784 1794 +10 Misses 7 7 ```

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

mesozoic commented 10 months ago

I know this follows the existing pattern, but I'll admit that I'm not sure the current layout of the formulas module adds a lot of value. It doesn't strike me as being any easier to type formulas.GREATER_THAN(a, b) than the equivalent f"{a} > {b}".

I'm working on a branch that will (among other things) apply to_airtable_value to all function parameters, so if they're decimals or dates or some other type that needs Airtable-specific formatting, it's not the responsibility of the caller. But that branch is going to be a breaking change for a 3.0 release, because there's no real way to do it in a totally backwards-compatible manner.

I'm going to merge this branch because tests pass and it follows existing convention, but I will probably still propose breaking changes to this module for the next major release.

mesozoic commented 10 months ago

Thanks for contributing!