Skip to content

Commit e7131fe

Browse files
authored
docs: document the 404 behavior of log.get_as_bytes() and log.stream() (#1104)
Adds the 404 note from `log.get()` to the sync and async `get_as_bytes()` and `stream()` docstrings. A 404 returns `None` only when the client targets a log by ID (`client.log(run_id)`). A chained client (`run.log()`) raises it. Closes: #1103 *✍️ Drafted by Claude Code*
1 parent b2bafde commit e7131fe

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • src/apify_client/_resource_clients

‎src/apify_client/_resource_clients/log.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def get_as_bytes(self, *, raw: bool = False, timeout: Timeout = 'long') -> bytes
6969
7070
https://docs.apify.com/api/v2#/reference/logs/log/get-log
7171
72+
404s collapse to `None` only when this client targets a specific log by ID (e.g.
73+
`client.log(run_id).get_as_bytes()`). For chained clients without a `resource_id` (e.g.
74+
`run.log().get_as_bytes()`), a 404 is ambiguous and propagates.
75+
7276
Args:
7377
raw: If true, the log will include formatting. For example, coloring character sequences.
7478
timeout: Timeout for the API HTTP request.
@@ -97,6 +101,9 @@ def stream(self, *, raw: bool = False, timeout: Timeout = 'long') -> Iterator[Ht
97101
98102
https://docs.apify.com/api/v2#/reference/logs/log/get-log
99103
104+
404s collapse to `None` only when this client targets a specific log by ID (e.g. `client.log(run_id).stream()`).
105+
For chained clients without a `resource_id` (e.g. `run.log().stream()`), a 404 is ambiguous and propagates.
106+
100107
Args:
101108
raw: If true, the log will include formatting. For example, coloring character sequences.
102109
timeout: Timeout for the API HTTP request.
@@ -177,6 +184,10 @@ async def get_as_bytes(self, *, raw: bool = False, timeout: Timeout = 'long') ->
177184
178185
https://docs.apify.com/api/v2#/reference/logs/log/get-log
179186
187+
404s collapse to `None` only when this client targets a specific log by ID (e.g.
188+
`client.log(run_id).get_as_bytes()`). For chained clients without a `resource_id` (e.g.
189+
`run.log().get_as_bytes()`), a 404 is ambiguous and propagates.
190+
180191
Args:
181192
raw: If true, the log will include formatting. For example, coloring character sequences.
182193
timeout: Timeout for the API HTTP request.
@@ -205,6 +216,9 @@ async def stream(self, *, raw: bool = False, timeout: Timeout = 'long') -> Async
205216
206217
https://docs.apify.com/api/v2#/reference/logs/log/get-log
207218
219+
404s collapse to `None` only when this client targets a specific log by ID (e.g. `client.log(run_id).stream()`).
220+
For chained clients without a `resource_id` (e.g. `run.log().stream()`), a 404 is ambiguous and propagates.
221+
208222
Args:
209223
raw: If true, the log will include formatting. For example, coloring character sequences.
210224
timeout: Timeout for the API HTTP request.

0 commit comments

Comments
 (0)