Skip to content

Commit d9b354d

Browse files
gadomskijsignell
andauthored
fix: documentation for retry attribute (#1358)
Co-authored-by: Julia Signell <[email protected]>
1 parent 346ff74 commit d9b354d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pystac/stac_io.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def read_json(self, source: HREF, *args: Any, **kwargs: Any) -> dict[str, Any]:
375375

376376
@staticmethod
377377
def _report_duplicate_object_names(
378-
object_pairs: list[tuple[str, Any]]
378+
object_pairs: list[tuple[str, Any]],
379379
) -> dict[str, Any]:
380380
result: dict[str, Any] = {}
381381
for key, value in object_pairs:
@@ -414,17 +414,16 @@ class RetryStacIO(DefaultStacIO):
414414
415415
"""
416416

417-
retry: Retry
418-
"""The :py:class:`urllib3.util.retry.Retry` to use with all reading network
419-
requests."""
420-
421417
def __init__(
422418
self,
423419
headers: dict[str, str] | None = None,
424420
retry: Retry | None = None,
425421
):
426422
super().__init__(headers)
423+
427424
self.retry = retry or Retry()
425+
"""The :py:class:`urllib3.util.retry.Retry` to use with all reading network
426+
requests."""
428427

429428
def read_text_from_href(self, href: str) -> str:
430429
"""Reads file as a UTF-8 string, with retry support.
@@ -438,7 +437,9 @@ def read_text_from_href(self, href: str) -> str:
438437
http = PoolManager()
439438
try:
440439
response = http.request(
441-
"GET", href, retries=self.retry # type: ignore
440+
"GET",
441+
href,
442+
retries=self.retry, # type: ignore
442443
)
443444
return cast(str, response.data.decode("utf-8"))
444445
except HTTPError as e:

0 commit comments

Comments
 (0)