pyairtable icon indicating copy to clipboard operation
pyairtable copied to clipboard

[RFC] Add Retrying Session

Open gtalarico opened this issue 2 years ago • 2 comments

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])
  • left retry_strategy args as is to avoid duplicating their docs and mapping args names. Docs just references Retry lib docs.
  • retry_strategy simply generates a default retry strategy but allows easy modification

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

gtalarico avatar Jul 13 '22 06:07 gtalarico

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.

codecov-commenter avatar Jul 13 '22 07:07 codecov-commenter

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

borland667 avatar Jul 13 '22 14:07 borland667

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

borland667 avatar Oct 13 '22 14:10 borland667