Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry with new Access Token on 419 response #340

Merged
merged 10 commits into from
Feb 20, 2024

Conversation

anupam-saini
Copy link
Contributor

Closes #234

  • Attempts to retry 2 more times if the initial call fails.
  • The retry is only triggered for AuthorizationExpiredError response.

pyiceberg/catalog/rest.py Outdated Show resolved Hide resolved
pyiceberg/catalog/rest.py Outdated Show resolved Hide resolved
rest_catalog._refresh_token() # pylint: disable=protected-access


_RETRY_ARGS = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like this 👍

@Fokko Fokko added this to the PyIceberg 0.7.0 release milestone Feb 7, 2024
Copy link
Contributor

@HonahX HonahX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @anupam-saini

@Fokko Fokko merged commit 82d8892 into apache:main Feb 20, 2024
6 checks passed
sungwy pushed a commit to sungwy/iceberg-python that referenced this pull request Feb 20, 2024
* Refresh Auth token on expiry

* Check call count

* Add test to cover retry logic

* Update poetry.lock with tenacity

* Fix tests for Python <= 3.9
@anupam-saini anupam-saini deleted the as-token-refresh branch February 21, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rest Catalog Refresh Access Token with stored CLIENT_ID and CLIENT_SECRET
3 participants