gtalarico / pyairtable

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

[RFC] Add Retrying Session #166

Closed gtalarico closed 2 years ago

gtalarico commented 2 years ago

Based on #165 and #143

Here is the proposed api:

from pyairtable import Api,retry_strategy

# current
api = Api("key", "base", "table")

# w/ default retry
api = Api("key", "base", "table", retry_strategy=retry_strategy())

# w/ customized retry
api = Api("key", "base", "table", retry_strategy=retry_strategy(total=5)
api = Api("key", "base", "table", retry_strategy=retry_strategy(status_forcelist=[429])

PR Includes tests + docs Opening up for feedback! @@borland667

codecov-commenter commented 2 years ago

Codecov Report

Merging #166 (d4b3441) into main (b7bd086) will increase coverage by 0.20%. The diff coverage is 94.44%.

@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
+ Coverage   87.08%   87.28%   +0.20%     
==========================================
  Files          13       15       +2     
  Lines         596      629      +33     
==========================================
+ Hits          519      549      +30     
- Misses         77       80       +3     
Impacted Files Coverage Δ
pyairtable/compat.py 83.33% <83.33%> (ø)
pyairtable/api/retrying.py 88.88% <88.88%> (ø)
pyairtable/__init__.py 100.00% <100.00%> (ø)
pyairtable/api/abstract.py 100.00% <100.00%> (ø)
pyairtable/api/api.py 76.31% <100.00%> (+0.64%) :arrow_up:
pyairtable/api/base.py 78.37% <100.00%> (+0.60%) :arrow_up:
pyairtable/api/table.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b7bd086...d4b3441. Read the comment docs.

borland667 commented 2 years ago

My two cents :) Awesome work anyway! Thanks!!!

borland667 commented 2 years ago

Hi @gtalarico is there anything I can do to help merging this one?