pyairtable icon indicating copy to clipboard operation
pyairtable copied to clipboard

Add Literal with date-time units for DATEADD and DATETIME_DIFF.

Open rafalkrupinski opened this issue 6 months ago • 2 comments

rafalkrupinski avatar May 12 '25 08:05 rafalkrupinski

Hi there! Thanks for the idea. It's an interesting thought to get more precise about the type annotations on these function signatures. There are probably other places where we could do something similar.

One challenge is that these are (currently) auto-generated by make format based on a text file which I extracted from Airtable's documentation. I'm hesitant to maintain this section by hand, because it'll be more time-consuming to update in the future when Airtable adds/changes their formula functions (or if we need to change how the library handles it).

mesozoic avatar May 17 '25 05:05 mesozoic

Ah, you use cog for that... I didn't see that one coming ;)

Anyway, it shouldn't be too hard to extend the format with standard python type annotation syntax, accept variable: type and turn it to variable: type | Formula (| None for optional). WDYT

rafalkrupinski avatar May 18 '25 10:05 rafalkrupinski