Thanks, but, unfortunately, it’s not my Airtable. I have to query a client’s Airtable for a service my company provides so I can’t really use it as a sandbox.
The quoting is because it’s written in Python. You can’t pass a string to a function in Python without quotes. In any case, the function doesn’t throw an error so it appears it’s able to digest the formula.
The question is, why doesn’t it appear to work as expected?
I don’t know how your Python code forms the url parameters for the request, but the API documentation shows that before url encoding, the filterByFormula parameter should not have quotes in it. If the formula is completely enclosed with quotes, then the formula is basically just a text string, and it will always evaluate to true.
Even though you cannot test the formula in your client’s actual base, you should be able to create a base of your own with similar fields and data to test the formula.
Conversion of the string to an actual formula Airtable understands is handled by the Python wrapper as can be seen here: Parameter Filters — Airtable Python Wrapper documentation
This is a very common schema for many programming languages. There are only four base object types in Python - numbers, booleans, datetimes and strings. Since the other three base object types can’t hold a complex query it must be passed as a string and then parsed by the function you pass it to.