causilo-client 1.0.2__tar.gz → 1.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: causilo-client
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Python client for the Causilo inference API
5
5
  Author: Nums AI
6
6
  License-Expression: LicenseRef-Proprietary
@@ -127,8 +127,13 @@ credential was refused) and `CausiloTimeout`. Timeouts are the one failure the
127
127
  client will not retry: the server is still computing, so instead it tells the
128
128
  server the call was abandoned, and `.refunded` says how many cells came back.
129
129
  The hosted API cannot stop a prediction once it has started (`POST /v1/cancel`
130
- answers 501 there), so against it `.refunded` is `None` and the call is
131
- counted in full. The default `timeout` is 900 seconds. The `RadixError` family of names from
130
+ answers 501 there), so against it `.refunded` is `None`: a call already running
131
+ when your own timeout fires finishes and is counted in full, and one still
132
+ queued is not run. The server's own limit is different: a call that cannot
133
+ finish within the time a request waits (900 seconds, the server stopping the
134
+ work about 30 seconds before that) is stopped, nothing is counted, and the
135
+ client raises `CausiloTimeout` from the server's 504. The default `timeout` is
136
+ 900 seconds, so that 504 arrives before it fires. The `RadixError` family of names from
132
137
  releases before 0.8.19 remains importable as aliases of the same classes, so an
133
138
  `except RadixError` written earlier still catches everything.
134
139
 
@@ -107,8 +107,13 @@ credential was refused) and `CausiloTimeout`. Timeouts are the one failure the
107
107
  client will not retry: the server is still computing, so instead it tells the
108
108
  server the call was abandoned, and `.refunded` says how many cells came back.
109
109
  The hosted API cannot stop a prediction once it has started (`POST /v1/cancel`
110
- answers 501 there), so against it `.refunded` is `None` and the call is
111
- counted in full. The default `timeout` is 900 seconds. The `RadixError` family of names from
110
+ answers 501 there), so against it `.refunded` is `None`: a call already running
111
+ when your own timeout fires finishes and is counted in full, and one still
112
+ queued is not run. The server's own limit is different: a call that cannot
113
+ finish within the time a request waits (900 seconds, the server stopping the
114
+ work about 30 seconds before that) is stopped, nothing is counted, and the
115
+ client raises `CausiloTimeout` from the server's 504. The default `timeout` is
116
+ 900 seconds, so that 504 arrives before it fires. The `RadixError` family of names from
112
117
  releases before 0.8.19 remains importable as aliases of the same classes, so an
113
118
  `except RadixError` written earlier still catches everything.
114
119
 
@@ -64,4 +64,4 @@ __all__ = [
64
64
  "MODELS",
65
65
  "to_batch_parquet",
66
66
  ]
67
- __version__ = "1.0.2"
67
+ __version__ = "1.0.4"
@@ -1174,10 +1174,15 @@ def _to_error(response: requests.Response) -> CausiloError:
1174
1174
  request_id=request_id,
1175
1175
  )
1176
1176
  if status == 504:
1177
+ # The server's own sentence when it sent one: it says whether the
1178
+ # charge was released, which this client cannot know (2026-11-02).
1179
+ said = str(doc.get("detail") or "").strip()
1177
1180
  return CausiloTimeout(
1178
- "The service did not finish this request within its own timeout "
1179
- "(504). It was charged and is probably still running, so the call "
1180
- "was not retried. Send a smaller table.",
1181
+ (f"{said} (504; not retried.)" if said else
1182
+ "The service stopped this request because it could not finish "
1183
+ "within the time a request waits (504). It was not retried, "
1184
+ "because the same table would take as long again: send a "
1185
+ "smaller table, or fewer rows at a time."),
1181
1186
  status=status,
1182
1187
  error_code=code,
1183
1188
  request_id=request_id,
@@ -1289,7 +1294,9 @@ def _causes(exc: BaseException):
1289
1294
  exc = exc.__cause__ or exc.__context__
1290
1295
 
1291
1296
 
1292
- # Statuses whose work was already charged, whatever the body claims.
1297
+ # Statuses never retried, whatever the body claims: a 502's work was already
1298
+ # charged, and a 504's table would take as long again (the service stops it
1299
+ # and charges nothing).
1293
1300
  _NEVER_RETRY_STATUS = frozenset({502, 504})
1294
1301
 
1295
1302
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: causilo-client
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Python client for the Causilo inference API
5
5
  Author: Nums AI
6
6
  License-Expression: LicenseRef-Proprietary
@@ -127,8 +127,13 @@ credential was refused) and `CausiloTimeout`. Timeouts are the one failure the
127
127
  client will not retry: the server is still computing, so instead it tells the
128
128
  server the call was abandoned, and `.refunded` says how many cells came back.
129
129
  The hosted API cannot stop a prediction once it has started (`POST /v1/cancel`
130
- answers 501 there), so against it `.refunded` is `None` and the call is
131
- counted in full. The default `timeout` is 900 seconds. The `RadixError` family of names from
130
+ answers 501 there), so against it `.refunded` is `None`: a call already running
131
+ when your own timeout fires finishes and is counted in full, and one still
132
+ queued is not run. The server's own limit is different: a call that cannot
133
+ finish within the time a request waits (900 seconds, the server stopping the
134
+ work about 30 seconds before that) is stopped, nothing is counted, and the
135
+ client raises `CausiloTimeout` from the server's 504. The default `timeout` is
136
+ 900 seconds, so that 504 arrives before it fires. The `RadixError` family of names from
132
137
  releases before 0.8.19 remains importable as aliases of the same classes, so an
133
138
  `except RadixError` written earlier still catches everything.
134
139
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "causilo-client"
7
- version = "1.0.2"
7
+ version = "1.0.4"
8
8
  description = "Python client for the Causilo inference API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
File without changes