You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "Eliaaazzz (via GitHub)" <gi...@apache.org> on 2026/03/25 03:50:03 UTC
[PR] [Integration] Expose length-aware batching in all ModelHandler subcla… [beam]
Eliaaazzz opened a new pull request, #37945:
URL: https://github.com/apache/beam/pull/37945
## Summary
Addresses #37531.
This PR completes the smart bucketing integration for Python `RunInference` by exposing `batch_length_fn` and `batch_bucket_boundaries` on all concrete `ModelHandler` implementations.
The underlying batching support already exists in the base layer. The missing piece was that many user-facing handlers did not surface these options, which made length-aware batching effectively unavailable for a large part of the inference API surface. With this change, users can enable smart bucketing directly from the handler constructor across supported backends.
## What Changed
This change adds `batch_length_fn` and `batch_bucket_boundaries` to 16 concrete handlers across the following backends:
- PyTorch
- HuggingFace
- scikit-learn
- TensorFlow
- ONNX
- XGBoost
- TensorRT
- vLLM
- Vertex AI
- Gemini
Implementation details:
- Handlers that inherit from `ModelHandler` now pass the new parameters through to `super().__init__()`
- Remote handlers that manage batching kwargs directly (`GeminiModelHandler` and `VertexAIModelHandlerJSON`) now wire the values into `_batching_kwargs`
## Testing
Added test coverage in `base_test.py` for both behavior and wiring:
- an end-to-end `RunInferenceLengthAwareBatchingTest` that verifies short and long string inputs are bucketed into separate batches under `FnApiRunner`
- a `HandlerBucketingKwargsForwardingTest` that checks each concrete handler forwards `batch_length_fn` and `batch_bucket_boundaries` into `batch_elements_kwargs()`
- follow-up fixes to keep the forwarding tests hermetic, especially for HuggingFace pipeline validation and Vertex AI endpoint liveness checks
## Context
This is the final integration piece for smart bucketing:
- Part 1: #37532
- Part 2: #37565
Together, these changes make length-aware batching usable through the public Python inference handlers rather than only at the base implementation layer.
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37945:
URL: https://github.com/apache/beam/pull/37945#issuecomment-4123985466
Assigning reviewers:
R: @shunping for label python.
Note: If you would like to opt out of this review, comment `assign to next reviewer`.
Available commands:
- `stop reviewer notifications` - opt out of the automated review tooling
- `remind me after tests pass` - tag the comment author after tests pass
- `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review comments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "Eliaaazzz (via GitHub)" <gi...@apache.org>.
Eliaaazzz commented on code in PR #37945:
URL: https://github.com/apache/beam/pull/37945#discussion_r3010163107
##########
sdks/python/apache_beam/ml/inference/base_test.py:
##########
@@ -2319,6 +2322,264 @@ def test_batching_kwargs_none_values_omitted(self):
self.assertEqual(kwargs['min_batch_size'], 5)
+class PaddingReportingStringModelHandler(base.ModelHandler[str, str,
+ FakeModel]):
+ """Reports each element with the max length of the batch it ran in."""
+ def load_model(self):
+ return FakeModel()
+
+ def run_inference(self, batch, model, inference_args=None):
+ max_len = max(len(s) for s in batch)
+ return [f'{s}:{max_len}' for s in batch]
+
+
+class RunInferenceLengthAwareBatchingTest(unittest.TestCase):
+ """End-to-end tests for PR2 length-aware batching in RunInference."""
+ def test_run_inference_with_length_aware_batch_elements(self):
+ handler = PaddingReportingStringModelHandler(
+ min_batch_size=2,
+ max_batch_size=2,
+ max_batch_duration_secs=60,
+ batch_length_fn=len,
+ batch_bucket_boundaries=[5])
+
+ examples = ['a', 'cccccc', 'bb', 'ddddddd']
+ with TestPipeline('FnApiRunner') as p:
+ results = (
+ p
+ | beam.Create(examples, reshuffle=False)
+ | base.RunInference(handler))
+ assert_that(results, equal_to(['a:2', 'bb:2', 'cccccc:7', 'ddddddd:7']))
+
+
+class HandlerBucketingKwargsForwardingTest(unittest.TestCase):
Review Comment:
> Actually, I would probably just remove these tests actually; as it stands, the only thing they protect us against is removing one of these arguments, which almost certainly would need to be intentional or obvious from the diff.
And agreed on the kwargs forwarding tests as well. I’ll remove them since they don’t add much protection beyond catching obvious or intentional argument changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on PR #37945:
URL: https://github.com/apache/beam/pull/37945#issuecomment-4143243385
@damccorm, could you help with this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "Eliaaazzz (via GitHub)" <gi...@apache.org>.
Eliaaazzz commented on code in PR #37945:
URL: https://github.com/apache/beam/pull/37945#discussion_r2985585544
##########
sdks/python/apache_beam/ml/inference/base_test.py:
##########
@@ -2319,6 +2319,234 @@ def test_batching_kwargs_none_values_omitted(self):
self.assertEqual(kwargs['min_batch_size'], 5)
+class PaddingReportingStringModelHandler(base.ModelHandler[str, str,
+ FakeModel]):
+ """Reports each element with the max length of the batch it ran in."""
+ def load_model(self):
+ return FakeModel()
+
+ def run_inference(self, batch, model, inference_args=None):
+ max_len = max(len(s) for s in batch)
+ return [f'{s}:{max_len}' for s in batch]
+
+
+class RunInferenceLengthAwareBatchingTest(unittest.TestCase):
+ """End-to-end tests for PR2 length-aware batching in RunInference."""
+ def test_run_inference_with_length_aware_batch_elements(self):
+ handler = PaddingReportingStringModelHandler(
+ min_batch_size=2,
+ max_batch_size=2,
+ max_batch_duration_secs=60,
+ batch_length_fn=len,
+ batch_bucket_boundaries=[5])
+
+ examples = ['a', 'cccccc', 'bb', 'ddddddd']
+ with TestPipeline('FnApiRunner') as p:
+ results = (
+ p
+ | beam.Create(examples, reshuffle=False)
+ | base.RunInference(handler))
+ assert_that(results, equal_to(['a:2', 'bb:2', 'cccccc:7', 'ddddddd:7']))
+
+
+class HandlerBucketingKwargsForwardingTest(unittest.TestCase):
Review Comment:
Good point. These cases all exercise the same forwarding assertion with different handler constructors, so I can consolidate them into a single data-driven test using `subTest`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subcla… [beam]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on PR #37945:
URL: https://github.com/apache/beam/pull/37945#issuecomment-4122954011
## Summary of Changes
Hello, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly enhances the `RunInference` API by making length-aware batching widely accessible. It integrates smart bucketing capabilities into numerous `ModelHandler` implementations, allowing users to leverage this feature directly from handler constructors across diverse machine learning backends. This change completes a multi-part effort to enable more efficient inference processing by grouping inputs of similar lengths.
### Highlights
* **Expanded Length-Aware Batching**: Exposed `batch_length_fn` and `batch_bucket_boundaries` in 16 concrete `ModelHandler` implementations across various ML backends (PyTorch, HuggingFace, scikit-learn, TensorFlow, ONNX, XGBoost, TensorRT, vLLM, Vertex AI, Gemini).
* **Enhanced `RunInference` API**: Enabled length-aware batching for Python `RunInference` across a wider range of inference APIs, making smart bucketing broadly available to users.
* **Implementation Details**: Implemented parameter forwarding to `super().__init__()` for most handlers and direct wiring into `_batching_kwargs` for remote handlers like Gemini and Vertex AI.
* **Comprehensive Testing**: Added new test coverage in `base_test.py` including an end-to-end length-aware batching test and dedicated tests for verifying bucketing kwargs forwarding across handlers.
🧠 **New Feature in Public Preview:** You can now enable **Memory** to help **Gemini Code Assist** learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. **Click [here](https://codeassist.google/code-review/login) to enable Memory in your admin console.**
<details>
<summary><b>Using Gemini Code Assist</b></summary>
<br>
The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.
<b>Invoking Gemini</b>
You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page.
Feature | Command | Description
--- | --- | ---
Code Review | `/gemini review` | Performs a code review for the current pull request in its current state.
Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state.
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help | `/gemini help` | Displays a list of available commands.
<b>Customization</b>
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github).
<b>Limitations & Feedback</b>
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG).
</details>
[^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on code in PR #37945:
URL: https://github.com/apache/beam/pull/37945#discussion_r3010006958
##########
sdks/python/apache_beam/ml/inference/base_test.py:
##########
@@ -2319,6 +2322,264 @@ def test_batching_kwargs_none_values_omitted(self):
self.assertEqual(kwargs['min_batch_size'], 5)
+class PaddingReportingStringModelHandler(base.ModelHandler[str, str,
+ FakeModel]):
+ """Reports each element with the max length of the batch it ran in."""
+ def load_model(self):
+ return FakeModel()
+
+ def run_inference(self, batch, model, inference_args=None):
+ max_len = max(len(s) for s in batch)
+ return [f'{s}:{max_len}' for s in batch]
+
+
+class RunInferenceLengthAwareBatchingTest(unittest.TestCase):
+ """End-to-end tests for PR2 length-aware batching in RunInference."""
+ def test_run_inference_with_length_aware_batch_elements(self):
+ handler = PaddingReportingStringModelHandler(
+ min_batch_size=2,
+ max_batch_size=2,
+ max_batch_duration_secs=60,
+ batch_length_fn=len,
+ batch_bucket_boundaries=[5])
+
+ examples = ['a', 'cccccc', 'bb', 'ddddddd']
+ with TestPipeline('FnApiRunner') as p:
+ results = (
+ p
+ | beam.Create(examples, reshuffle=False)
+ | base.RunInference(handler))
+ assert_that(results, equal_to(['a:2', 'bb:2', 'cccccc:7', 'ddddddd:7']))
+
+
+class HandlerBucketingKwargsForwardingTest(unittest.TestCase):
+ """Verify each concrete ModelHandler forwards batch_length_fn and
+ batch_bucket_boundaries through to batch_elements_kwargs()."""
+ _BUCKETING_KWARGS = {
+ 'batch_length_fn': len,
+ 'batch_bucket_boundaries': [32],
+ }
+
+ def _assert_bucketing_kwargs_forwarded(self, handler):
+ kwargs = handler.batch_elements_kwargs()
+ self.assertIs(kwargs['length_fn'], len)
+ self.assertEqual(kwargs['bucket_boundaries'], [32])
+
+ def _load_handler_class(self, case):
+ try:
+ module = importlib.import_module(case['module_name'])
+ except ImportError:
+ raise unittest.SkipTest(case['skip_message'])
Review Comment:
Rather than taking in a skip_message, we can just grab the module name; that way we don't mask the cause if our skip message is wrong.
```
except ImportError as e:
raise unittest.SkipTest(f"Could not import {e.name}")
```
##########
sdks/python/apache_beam/ml/inference/base_test.py:
##########
@@ -2319,6 +2322,264 @@ def test_batching_kwargs_none_values_omitted(self):
self.assertEqual(kwargs['min_batch_size'], 5)
+class PaddingReportingStringModelHandler(base.ModelHandler[str, str,
+ FakeModel]):
+ """Reports each element with the max length of the batch it ran in."""
+ def load_model(self):
+ return FakeModel()
+
+ def run_inference(self, batch, model, inference_args=None):
+ max_len = max(len(s) for s in batch)
+ return [f'{s}:{max_len}' for s in batch]
+
+
+class RunInferenceLengthAwareBatchingTest(unittest.TestCase):
+ """End-to-end tests for PR2 length-aware batching in RunInference."""
+ def test_run_inference_with_length_aware_batch_elements(self):
+ handler = PaddingReportingStringModelHandler(
+ min_batch_size=2,
+ max_batch_size=2,
+ max_batch_duration_secs=60,
+ batch_length_fn=len,
+ batch_bucket_boundaries=[5])
+
+ examples = ['a', 'cccccc', 'bb', 'ddddddd']
+ with TestPipeline('FnApiRunner') as p:
+ results = (
+ p
+ | beam.Create(examples, reshuffle=False)
+ | base.RunInference(handler))
+ assert_that(results, equal_to(['a:2', 'bb:2', 'cccccc:7', 'ddddddd:7']))
+
+
+class HandlerBucketingKwargsForwardingTest(unittest.TestCase):
Review Comment:
Actually, I would probably just remove these tests actually; as it stands, the only thing they protect us against is removing one of these arguments, which almost certainly would need to be intentional or obvious from the diff.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "Eliaaazzz (via GitHub)" <gi...@apache.org>.
Eliaaazzz commented on PR #37945:
URL: https://github.com/apache/beam/pull/37945#issuecomment-4155792484
@damccorm Thanks for the review, I removed the kwargs forwarding tests as suggested. Since the separate `skip_message` handling was only used in that test class, removing it also addressed the import-skip comment there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #37945:
URL: https://github.com/apache/beam/pull/37945#discussion_r2985574367
##########
sdks/python/apache_beam/ml/inference/base_test.py:
##########
@@ -2319,6 +2319,234 @@ def test_batching_kwargs_none_values_omitted(self):
self.assertEqual(kwargs['min_batch_size'], 5)
+class PaddingReportingStringModelHandler(base.ModelHandler[str, str,
+ FakeModel]):
+ """Reports each element with the max length of the batch it ran in."""
+ def load_model(self):
+ return FakeModel()
+
+ def run_inference(self, batch, model, inference_args=None):
+ max_len = max(len(s) for s in batch)
+ return [f'{s}:{max_len}' for s in batch]
+
+
+class RunInferenceLengthAwareBatchingTest(unittest.TestCase):
+ """End-to-end tests for PR2 length-aware batching in RunInference."""
+ def test_run_inference_with_length_aware_batch_elements(self):
+ handler = PaddingReportingStringModelHandler(
+ min_batch_size=2,
+ max_batch_size=2,
+ max_batch_duration_secs=60,
+ batch_length_fn=len,
+ batch_bucket_boundaries=[5])
+
+ examples = ['a', 'cccccc', 'bb', 'ddddddd']
+ with TestPipeline('FnApiRunner') as p:
+ results = (
+ p
+ | beam.Create(examples, reshuffle=False)
+ | base.RunInference(handler))
+ assert_that(results, equal_to(['a:2', 'bb:2', 'cccccc:7', 'ddddddd:7']))
+
+
+class HandlerBucketingKwargsForwardingTest(unittest.TestCase):
Review Comment:

The test methods in this class are very repetitive. To improve maintainability and reduce code duplication, consider parameterizing these tests. You could use a library like `parameterized` or `unittest.TestCase.subTest` with a loop over a list of handler configurations. Each configuration could specify the handler class, its specific `__init__` arguments, and any necessary mocks or setup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm merged PR #37945:
URL: https://github.com/apache/beam/pull/37945
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "Eliaaazzz (via GitHub)" <gi...@apache.org>.
Eliaaazzz commented on PR #37945:
URL: https://github.com/apache/beam/pull/37945#issuecomment-4138975792
@shunping Hi could you please have a look? All three failed checks show the same infrastructure error: "The self-hosted runner lost communication with the server." No tests actually failed before the runner disconnected. This appears to be a transient Apache Beam CI infrastructure issue with the self-hosted runner dropping offline during execution, and it is unrelated to the changes in this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subclasses [beam]
Posted by "Eliaaazzz (via GitHub)" <gi...@apache.org>.
Eliaaazzz commented on code in PR #37945:
URL: https://github.com/apache/beam/pull/37945#discussion_r3010161015
##########
sdks/python/apache_beam/ml/inference/base_test.py:
##########
@@ -2319,6 +2322,264 @@ def test_batching_kwargs_none_values_omitted(self):
self.assertEqual(kwargs['min_batch_size'], 5)
+class PaddingReportingStringModelHandler(base.ModelHandler[str, str,
+ FakeModel]):
+ """Reports each element with the max length of the batch it ran in."""
+ def load_model(self):
+ return FakeModel()
+
+ def run_inference(self, batch, model, inference_args=None):
+ max_len = max(len(s) for s in batch)
+ return [f'{s}:{max_len}' for s in batch]
+
+
+class RunInferenceLengthAwareBatchingTest(unittest.TestCase):
+ """End-to-end tests for PR2 length-aware batching in RunInference."""
+ def test_run_inference_with_length_aware_batch_elements(self):
+ handler = PaddingReportingStringModelHandler(
+ min_batch_size=2,
+ max_batch_size=2,
+ max_batch_duration_secs=60,
+ batch_length_fn=len,
+ batch_bucket_boundaries=[5])
+
+ examples = ['a', 'cccccc', 'bb', 'ddddddd']
+ with TestPipeline('FnApiRunner') as p:
+ results = (
+ p
+ | beam.Create(examples, reshuffle=False)
+ | base.RunInference(handler))
+ assert_that(results, equal_to(['a:2', 'bb:2', 'cccccc:7', 'ddddddd:7']))
+
+
+class HandlerBucketingKwargsForwardingTest(unittest.TestCase):
+ """Verify each concrete ModelHandler forwards batch_length_fn and
+ batch_bucket_boundaries through to batch_elements_kwargs()."""
+ _BUCKETING_KWARGS = {
+ 'batch_length_fn': len,
+ 'batch_bucket_boundaries': [32],
+ }
+
+ def _assert_bucketing_kwargs_forwarded(self, handler):
+ kwargs = handler.batch_elements_kwargs()
+ self.assertIs(kwargs['length_fn'], len)
+ self.assertEqual(kwargs['bucket_boundaries'], [32])
+
+ def _load_handler_class(self, case):
+ try:
+ module = importlib.import_module(case['module_name'])
+ except ImportError:
+ raise unittest.SkipTest(case['skip_message'])
Review Comment:
> Rather than taking in a skip_message, we can just grab the module name; that way we don't mask the cause if our skip message is wrong.
>
> ```
> except ImportError as e:
> raise unittest.SkipTest(f"Could not import {e.name}")
> ```
Thanks, that makes sense. I’ll derive the skip reason directly from the `ImportError` rather than passing a separate `skip_message`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Integration] Expose length-aware batching in all ModelHandler subcla… [beam]
Posted by "Eliaaazzz (via GitHub)" <gi...@apache.org>.
Eliaaazzz commented on PR #37945:
URL: https://github.com/apache/beam/pull/37945#issuecomment-4122953848
./gemini review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org