Skip to content

Commit bc09010

Browse files
committed
fix: add remaining pyright ignores for async functions
1 parent d29fa37 commit bc09010

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/replicate/lib/_predictions_run.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,19 @@ async def async_run(
131131
if version_id is not None:
132132
# Create prediction with the specific version ID
133133
params_with_version: PredictionCreateParams = {**params, "version": version_id}
134-
prediction = await client.predictions.create(
134+
prediction = await client.predictions.create( # pyright: ignore[reportCallIssue, reportUnknownVariableType]
135135
file_encoding_strategy=file_encoding_strategy, **params_with_version
136136
)
137137
elif owner and name:
138138
# Create prediction via models resource with owner/name
139-
prediction = await client.models.predictions.create(
139+
prediction = await client.models.predictions.create( # pyright: ignore[reportCallIssue, reportUnknownVariableType]
140140
model_owner=owner, model_name=name, file_encoding_strategy=file_encoding_strategy, **params
141141
)
142142
else:
143143
# If ref is a string but doesn't match expected patterns
144144
if isinstance(ref, str):
145145
params_with_version = {**params, "version": ref}
146-
prediction = await client.predictions.create(
146+
prediction = await client.predictions.create( # pyright: ignore[reportCallIssue, reportUnknownVariableType]
147147
file_encoding_strategy=file_encoding_strategy, **params_with_version
148148
)
149149
else:
@@ -169,14 +169,14 @@ async def async_run(
169169
# async for chunk in prediction.async_output_iterator()
170170
# )
171171

172-
prediction = await client.predictions.wait(prediction.id)
172+
prediction = await client.predictions.wait(prediction.id) # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType]
173173

174174
if prediction.status == "failed": # pyright: ignore[reportUnknownMemberType]
175175
raise ModelError(prediction) # pyright: ignore[reportUnknownArgumentType]
176176

177177
# Return an iterator for completed output if the model has an output iterator array type.
178-
if version and _has_output_iterator_array_type(version) and prediction.output is not None:
179-
return (transform_output(chunk, client) async for chunk in _make_async_iterator(prediction.output)) # type: ignore
178+
if version and _has_output_iterator_array_type(version) and prediction.output is not None: # pyright: ignore[reportUnknownMemberType]
179+
return (transform_output(chunk, client) async for chunk in _make_async_iterator(prediction.output)) # type: ignore # pyright: ignore[reportUnknownMemberType]
180180
if use_file_output:
181181
return transform_output(prediction.output, client) # type: ignore[no-any-return] # pyright: ignore[reportUnknownMemberType]
182182

tests/api_resources/models/test_predictions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Replicate) -> None:
4444
webhook="https://example.com/my-webhook-handler",
4545
webhook_events_filter=["start", "completed"],
4646
prefer="wait=5",
47-
replicate_max_lifetime="5m",
47+
replicate_max_lifetime="5m", # pyright: ignore[reportCallIssue]
4848
)
4949
assert_matches_type(Prediction, prediction, path=["response"]) # pyright: ignore[reportUnknownArgumentType]
5050

@@ -140,7 +140,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate)
140140
webhook="https://example.com/my-webhook-handler",
141141
webhook_events_filter=["start", "completed"],
142142
prefer="wait=5",
143-
replicate_max_lifetime="5m",
143+
replicate_max_lifetime="5m", # pyright: ignore[reportCallIssue]
144144
)
145145
assert_matches_type(Prediction, prediction, path=["response"]) # pyright: ignore[reportUnknownArgumentType]
146146

tests/api_resources/test_predictions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Replicate) -> None:
3838
webhook="https://example.com/my-webhook-handler",
3939
webhook_events_filter=["start", "completed"],
4040
prefer="wait=5",
41-
replicate_max_lifetime="5m",
41+
replicate_max_lifetime="5m", # pyright: ignore[reportCallIssue]
4242
)
4343
assert_matches_type(Prediction, prediction, path=["response"]) # pyright: ignore[reportUnknownArgumentType]
4444

@@ -216,7 +216,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate)
216216
webhook="https://example.com/my-webhook-handler",
217217
webhook_events_filter=["start", "completed"],
218218
prefer="wait=5",
219-
replicate_max_lifetime="5m",
219+
replicate_max_lifetime="5m", # pyright: ignore[reportCallIssue]
220220
)
221221
assert_matches_type(Prediction, prediction, path=["response"]) # pyright: ignore[reportUnknownArgumentType]
222222

0 commit comments

Comments
 (0)