This is an automated email from the ASF dual-hosted git repository.
jrmccluskey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new b04ca1e0cee Fix pyrefly check bad-specialization (#39419)
b04ca1e0cee is described below
commit b04ca1e0cee17751fc2d9255af6b8c5f9b402f68
Author: Jack McCluskey <[email protected]>
AuthorDate: Wed Jul 22 12:14:06 2026 -0400
Fix pyrefly check bad-specialization (#39419)
---
sdks/python/apache_beam/ml/inference/base.py | 3 +--
sdks/python/apache_beam/runners/portability/prism_runner.py | 5 ++++-
sdks/python/pyproject.toml | 1 -
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/sdks/python/apache_beam/ml/inference/base.py
b/sdks/python/apache_beam/ml/inference/base.py
index f81382bbeec..62c4047a961 100644
--- a/sdks/python/apache_beam/ml/inference/base.py
+++ b/sdks/python/apache_beam/ml/inference/base.py
@@ -361,8 +361,7 @@ class ModelHandler(Generic[ExampleT, PredictionT, ModelT]):
def with_no_batching(
self
- ) -> """ModelHandler[Union[
- ExampleT, Iterable[ExampleT]], PostProcessT, ModelT, PostProcessT]""":
+ ) -> 'ModelHandler[Union[ExampleT, Iterable[ExampleT]], PredictionT,
ModelT]':
"""Returns a new ModelHandler which does not require batching
of inputs so that RunInference will skip this step. RunInference will
expect the input to be pre-batched and passed in as an Iterable of records.
diff --git a/sdks/python/apache_beam/runners/portability/prism_runner.py
b/sdks/python/apache_beam/runners/portability/prism_runner.py
index 105c27fcb8c..3ebe94ef160 100644
--- a/sdks/python/apache_beam/runners/portability/prism_runner.py
+++ b/sdks/python/apache_beam/runners/portability/prism_runner.py
@@ -291,7 +291,10 @@ class PrismJobServer(job_server.SubprocessJobServer):
except ValueError:
url_read = urlopen(url)
with open(cached_file + '.tmp', 'wb') as zip_write:
- shutil.copyfileobj(url_read, zip_write, length=1 << 20)
+ shutil.copyfileobj(
+ typing.cast(typing.BinaryIO, url_read),
+ zip_write,
+ length=1 << 20)
_rename_if_different(cached_file + '.tmp', cached_file)
except URLError as e:
diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml
index 5d78db86336..d5a2b2c2f28 100644
--- a/sdks/python/pyproject.toml
+++ b/sdks/python/pyproject.toml
@@ -212,7 +212,6 @@ invalid-argument = "ignore"
invalid-inheritance = "ignore"
not-iterable = "ignore"
unexpected-keyword = "ignore"
-bad-specialization = "ignore"
invalid-yield = "ignore"
bad-argument-count = "ignore"
bad-typed-dict-key = "ignore"