-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow more flexible config of retry decorator (#289)
Option to specify retry exceptions as a dictionary instead of a tuple. Values should be a callable determining whether a specific exception object should be retied or not. __Example:__ ``` python @Retry( exceptions = {ValueError: lambda x: "Invalid" not in str(x)} ) def func() -> None: value = some_function() if value is None: raise ValueError("Could not retrieve value") if not_valid(value): raise ValueError(f"Invalid value: {value}") ``` Add requests_exceptions template, so you could do e.g. ``` python retry(exceptions = request_exceptions()) ``` if you're using requests
- Loading branch information
Showing
5 changed files
with
290 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "cognite-extractor-utils" | ||
version = "6.3.2" | ||
version = "6.4.0" | ||
description = "Utilities for easier development of extractors for CDF" | ||
authors = ["Mathias Lohne <[email protected]>"] | ||
license = "Apache-2.0" | ||
|
@@ -80,6 +80,9 @@ SecretStorage = "^3.1.2" | |
twine = "^4.0.0" | ||
pytest-order = "^1.0.1" | ||
parameterized = "*" | ||
requests = "^2.31.0" | ||
types-requests = "^2.31.0.20240125" | ||
httpx = "^0.26.0" | ||
|
||
[build-system] | ||
requires = ["poetry>=0.12"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters