Skip to content

Commit 9551263

Browse files
committed
fix: Move argument docs to a place where they render
1 parent 500dce6 commit 9551263

File tree

1 file changed

+32
-33
lines changed
  • clients/python/src/objectstore_client

1 file changed

+32
-33
lines changed

clients/python/src/objectstore_client/client.py

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,38 @@ class _ConnectionDefaults:
9090

9191

9292
class Client:
93-
"""A client for Objectstore. Constructing it initializes a connection pool."""
93+
"""
94+
A client for Objectstore. Constructing it initializes a connection pool.
95+
96+
Args:
97+
base_url: The base URL of the Objectstore server (e.g.,
98+
"http://objectstore:8888"). metrics_backend: Optional metrics backend for
99+
tracking storage operations. Defaults to ``NoOpMetricsBackend`` if not
100+
provided.
101+
propagate_traces: Whether to propagate Sentry trace headers in requests to
102+
objectstore. Defaults to ``False``.
103+
retries: Number of connection retries for failed requests.
104+
Defaults to ``3`` if not specified. **Note:** only connection failures are
105+
retried, not read failures (as compression streams cannot be rewound).
106+
timeout_ms: Read timeout in milliseconds for API requests. The read timeout
107+
is the maximum time to wait between consecutive read operations on the
108+
socket (i.e., between receiving chunks of data). Defaults to no read timeout
109+
if not specified. The connection timeout is always 100ms. To override the
110+
connection timeout, pass a custom ``urllib3.Timeout`` object via
111+
``connection_kwargs``. For example:
112+
113+
.. code-block:: python
114+
115+
client = Client(
116+
"http://objectstore:8888", connection_kwargs={
117+
"timeout": urllib3.Timeout(connect=1.0, read=5.0)
118+
}
119+
)
120+
121+
connection_kwargs: Additional keyword arguments to pass to the underlying
122+
urllib3 connection pool (e.g., custom headers, SSL settings, advanced
123+
timeouts).
124+
"""
94125

95126
def __init__(
96127
self,
@@ -102,38 +133,6 @@ def __init__(
102133
connection_kwargs: Mapping[str, Any] | None = None,
103134
token_generator: TokenGenerator | None = None,
104135
):
105-
"""
106-
Initialize an Objectstore client.
107-
108-
Args:
109-
base_url: The base URL of the Objectstore server (e.g.,
110-
"http://objectstore:8888"). metrics_backend: Optional metrics backend
111-
for tracking storage operations. Defaults to ``NoOpMetricsBackend`` if
112-
not provided.
113-
propagate_traces: Whether to propagate Sentry trace headers in requests to
114-
objectstore. Defaults to ``False``.
115-
retries: Number of connection retries for failed requests.
116-
Defaults to ``3`` if not specified. Note: only connection failures are
117-
retried, not read failures (as compression streams cannot be rewound).
118-
timeout_ms: Read timeout in milliseconds for API requests. The read timeout
119-
is the maximum time to wait between consecutive read operations on the
120-
socket (i.e., between receiving chunks of data). Defaults to no read
121-
timeout if not specified. The connection timeout is always 100ms. To
122-
override the connection timeout, pass a custom ``urllib3.Timeout``
123-
object via ``connection_kwargs``. For example:
124-
125-
.. code-block:: python
126-
127-
client = Client(
128-
"http://objectstore:8888", connection_kwargs={
129-
"timeout": urllib3.Timeout(connect=1.0, read=5.0)
130-
}
131-
)
132-
133-
connection_kwargs: Additional keyword arguments to pass to the underlying
134-
urllib3 connection pool (e.g., custom headers, SSL settings, advanced
135-
timeouts).
136-
"""
137136
connection_kwargs_to_use = asdict(_ConnectionDefaults())
138137

139138
if retries:

0 commit comments

Comments
 (0)