gtalarico / pyairtable

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

Reintroduce support for memoizing linked models #369

Closed mesozoic closed 4 months ago

mesozoic commented 4 months ago

In 6c1135dff251a39c078c9c1faa160a17b874a77a we removed the behavior of memoizing references to existing linked model instances because it was hard to test and led to unpredictable behavior. However, it is actually very useful to prefetch all linked models rather than grabbing them one by one via API calls, because it can be much faster.

This branch reintroduces memoization as an optional feature, with more granular control over how and when it happens.

mesozoic commented 4 months ago

Good catch :) I've updated tox.ini so that it runs mypy locally on every version of Python. Previously that only happened when running GitHub Actions.