From fc6119217c62beb7a006ee32e8b96533bf045a03 Mon Sep 17 00:00:00 2001 From: jrmccluskey Date: Wed, 11 Mar 2026 12:19:00 -0400 Subject: [PATCH 1/3] Fix bad-unpacking pyrefly error --- sdks/python/apache_beam/yaml/yaml_ml.py | 2 +- sdks/python/pyrefly.toml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sdks/python/apache_beam/yaml/yaml_ml.py b/sdks/python/apache_beam/yaml/yaml_ml.py index 4e750b79ce30..7d206217e704 100644 --- a/sdks/python/apache_beam/yaml/yaml_ml.py +++ b/sdks/python/apache_beam/yaml/yaml_ml.py @@ -488,7 +488,7 @@ def fn(x: PredictionResult): inference_args=inference_args) | beam.Map( lambda row: beam.Row(**{ - inference_tag: row[1], **row[0]._asdict() + str(inference_tag): row[1], **row[0]._asdict() })).with_output_types(schema)) diff --git a/sdks/python/pyrefly.toml b/sdks/python/pyrefly.toml index 3b6cc5e975ce..79fd75a46262 100644 --- a/sdks/python/pyrefly.toml +++ b/sdks/python/pyrefly.toml @@ -58,5 +58,4 @@ bad-context-manager = "ignore" invalid-yield = "ignore" bad-argument-count = "ignore" bad-typed-dict-key = "ignore" -no-access = "ignore" -bad-unpacking = "ignore" \ No newline at end of file +no-access = "ignore" \ No newline at end of file From 578a9b9c30188f7172ec2e8f1721163c465dfef7 Mon Sep 17 00:00:00 2001 From: jrmccluskey Date: Wed, 11 Mar 2026 12:52:35 -0400 Subject: [PATCH 2/3] formatting --- sdks/python/apache_beam/yaml/yaml_ml.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sdks/python/apache_beam/yaml/yaml_ml.py b/sdks/python/apache_beam/yaml/yaml_ml.py index 7d206217e704..fd0db3741b1f 100644 --- a/sdks/python/apache_beam/yaml/yaml_ml.py +++ b/sdks/python/apache_beam/yaml/yaml_ml.py @@ -487,9 +487,10 @@ def fn(x: PredictionResult): model_handler_provider._postprocess_fn_internal()), inference_args=inference_args) | beam.Map( - lambda row: beam.Row(**{ - str(inference_tag): row[1], **row[0]._asdict() - })).with_output_types(schema)) + lambda row: beam.Row( + **{ + str(inference_tag): row[1], **row[0]._asdict() + })).with_output_types(schema)) def _config_to_obj(spec): From 81e722964b9244be8c4fe56115ce33e77a95a4d8 Mon Sep 17 00:00:00 2001 From: jrmccluskey Date: Thu, 12 Mar 2026 10:40:13 -0400 Subject: [PATCH 3/3] gemini suggestion --- sdks/python/apache_beam/yaml/yaml_ml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/yaml/yaml_ml.py b/sdks/python/apache_beam/yaml/yaml_ml.py index fd0db3741b1f..51f18c733046 100644 --- a/sdks/python/apache_beam/yaml/yaml_ml.py +++ b/sdks/python/apache_beam/yaml/yaml_ml.py @@ -489,7 +489,7 @@ def fn(x: PredictionResult): | beam.Map( lambda row: beam.Row( **{ - str(inference_tag): row[1], **row[0]._asdict() + **row[0]._asdict(), str(inference_tag): row[1] })).with_output_types(schema))