You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "shunping (via GitHub)" <gi...@apache.org> on 2026/07/14 19:32:31 UTC

[PR] Fix test_get_python_sdk_name to use supported Python version [beam]

shunping opened a new pull request, #39328:
URL: https://github.com/apache/beam/pull/39328

   Update sys.version_info mock from 3.9 to 3.11 in test_get_python_sdk_name and format version check error message using sys.version_info for consistency.
   
   This is needed to fix the failure of `UtilTest::test_get_python_sdk_name` on a release branch (beam version without `dev`).
   
   Failed test run:
   https://github.com/apache/beam/actions/runs/29345736526/job/87128821341?pr=39325
   
   Traceback:
   (Notice that the error message is misleading though because it does not use the mocked variable. This has also been fixed in this PR)
   ```
   ______________________ UtilTest.test_get_python_sdk_name _______________________
   [gw0] linux -- Python 3.10.20 /runner/_work/beam/beam/sdks/python/test-suites/tox/py310/build/srcs/sdks/python/target/.tox-py310-cloud/py310-cloud/bin/python
   
   self = <apache_beam.runners.dataflow.internal.apiclient_test.UtilTest testMethod=test_get_python_sdk_name>
   
       @mock.patch(
           'apache_beam.runners.dataflow.internal.apiclient.sys.version_info',
           (3, 9))
       def test_get_python_sdk_name(self):
         pipeline_options = PipelineOptions([
             '--project',
             'test_project',
             '--job_name',
             'test_job_name',
             '--temp_location',
             'gs://test-location/temp',
             '--experiments',
             'beam_fn_api',
             '--experiments',
             'use_multiple_sdk_containers'
         ])
   >     environment = apiclient.Environment([],
                                             pipeline_options,
                                             '1',
                                             FAKE_PIPELINE_URL)
   
   apache_beam/runners/dataflow/internal/apiclient_test.py:1049: 
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
   target/.tox-py310-cloud/py310-cloud/lib/python3.10/site-packages/apache_beam/runners/dataflow/internal/apiclient.py:139: in __init__
       _verify_interpreter_version_is_supported(options)
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
   
   pipeline_options = <apache_beam.options.pipeline_options.PipelineOptions object at 0x7dac1838b160>
   
       def _verify_interpreter_version_is_supported(pipeline_options):
         if ('%s.%s' % (sys.version_info[0], sys.version_info[1])
             in _PYTHON_VERSIONS_SUPPORTED_BY_DATAFLOW):
           return
       
         if 'dev' in beam_version.__version__:
           return
       
         debug_options = pipeline_options.view_as(DebugOptions)
         if (debug_options.experiments and
             'use_unsupported_python_version' in debug_options.experiments):
           return
       
   >     raise Exception(
             'Dataflow runner currently supports Python versions %s, got %s.\n'
             'To ignore this requirement and start a job '
             'using an unsupported version of Python interpreter, pass '
             '--experiment use_unsupported_python_version pipeline option.' %
             (_PYTHON_VERSIONS_SUPPORTED_BY_DATAFLOW, sys.version))
   E     Exception: Dataflow runner currently supports Python versions ['3.10', '3.11', '3.12', '3.13', '3.14'], got 3.10.20 (main, Jun 16 2026, 21:01:32) [GCC 13.3.0].
   E     To ignore this requirement and start a job using an unsupported version of Python interpreter, pass --experiment use_unsupported_python_version pipeline option.
   ```


-- 
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] Fix test_get_python_sdk_name to use supported Python version [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39328:
URL: https://github.com/apache/beam/pull/39328#issuecomment-4974319912

   Assigning reviewers:
   
   R: @damccorm 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] Fix test_get_python_sdk_name to use supported Python version [beam]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on PR #39328:
URL: https://github.com/apache/beam/pull/39328#issuecomment-4973176730

   ## 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 addresses a test failure in the Dataflow runner's interpreter version verification logic. By updating the mocked Python version in the test suite and refining the error message format, the changes ensure that the verification logic behaves correctly and provides clearer feedback when an unsupported Python version is encountered.
   
   ### Highlights
   
   * **Test Compatibility**: Updated the sys.version_info mock in test_get_python_sdk_name from 3.9 to 3.11 to align with supported Python versions and resolve test failures.
   * **Error Reporting**: Improved the error message in _verify_interpreter_version_is_supported to use sys.version_info for more accurate and consistent reporting of the detected Python version.
   
   <details>
   <summary><b>New Features</b></summary>
   
   🧠 You can now enable **Memory** (public preview) 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>
   
   <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 the 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 counterproductive. 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] Fix test_get_python_sdk_name to use supported Python version [beam]

Posted by "Amar3tto (via GitHub)" <gi...@apache.org>.
Amar3tto merged PR #39328:
URL: https://github.com/apache/beam/pull/39328


-- 
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