Skip to content

Pin google-adk to 1.17.0 for YAML/Xlang precommit dependency resolution#38090

Open
aIbrahiim wants to merge 4 commits intoapache:masterfrom
aIbrahiim:fix-python-yaml-xlang-adk-resolution
Open

Pin google-adk to 1.17.0 for YAML/Xlang precommit dependency resolution#38090
aIbrahiim wants to merge 4 commits intoapache:masterfrom
aIbrahiim:fix-python-yaml-xlang-adk-resolution

Conversation

@aIbrahiim
Copy link
Copy Markdown
Contributor

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • 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.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions github-actions bot added the python label Apr 7, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! 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 updates the dependency management for the Python SDK by explicitly pinning the google-adk package to a specific version. This change ensures consistent behavior and stability for YAML and Xlang precommit workflows by preventing unexpected dependency resolution issues.

Highlights

  • Dependency Pinning: Pinned the google-adk package to version 1.17.0 in the Python SDK setup configuration.

🧠 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 to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

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.

Customization

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.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@aIbrahiim aIbrahiim closed this Apr 7, 2026
@aIbrahiim aIbrahiim reopened this Apr 7, 2026
@aIbrahiim aIbrahiim force-pushed the fix-python-yaml-xlang-adk-resolution branch from 4fe24d6 to a3da0f9 Compare April 7, 2026 21:07
@github-actions github-actions bot added the yaml label Apr 8, 2026
@aIbrahiim aIbrahiim force-pushed the fix-python-yaml-xlang-adk-resolution branch from 96bdf7b to 2232aa3 Compare April 8, 2026 09:47
@aIbrahiim aIbrahiim marked this pull request as ready for review April 8, 2026 09:47
'google-adk==1.28.1',
'opentelemetry-api==1.37.0',
'opentelemetry-sdk==1.37.0',
'opentelemetry-exporter-otlp-proto-http==1.37.0',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we need to pin these opentelemetry dependencies as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes as ADK fixes OTel versions, unpinned exporters were upgrading and conflicting with ADK’s SDK constraint, so i pined the trio to match

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and pip failed with something like google-adk 1.17.0 wants opentelemetry-sdk exactly 1.37.x, but pip pulled opentelemetry-exporter-otlp-proto-http 1.40.x, which requires opentelemetry-sdk~=1.40

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know where the opentelemetry requirement was coming from that installed 1.40.x? I would've expected that to be handled by pip

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pip was handling it, it ended in ResolutionImpossible / a hard conflict, not a wrong install and the 1.40.x side was coming from opentelemetry-exporter-otlp-proto-http (e.g. 1.40.0 wants opentelemetry-sdk~=1.40). google-adk meanwhile pins opentelemetry-sdk to 1.37.x, so theres no single version of the SDK that satisfies both so pip can’t merge those, it just fails unless we pin the exporter (and api) to the same minor as ADK’s SDK so nothing pulls 1.40.x into the graph

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but what requires opentelemetry-exporter-otlp-proto-http?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to pin opentelemetry-exporter-otlp-proto-http because otherwise pip kept grabbing a newer 1.40.x build that wants opentelemetry-sdk~=1.40, while ADK only lines up with 1.37.x so resolution blew up unless i locked the exporter to the same minor as the SDK @damccorm

@aIbrahiim
Copy link
Copy Markdown
Contributor Author

# match tft extra.
'tensorflow_transform>=1.14.0,<1.15.0',
# TFT->TFX-BSL require pandas 1.x, which is not compatible
# with numpy 2.x
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we need this anymore?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you mean protobuf<4, i dropped that cap because with ADK/OTel in the same extra it fought protobuf>=5. ml_test no longer pulls ADK, so that specific cap isnt what unblocks resolution anymore, we can revisit a narrower cap separately if [gcp]+[ml_test] still allows it.

'google-adk==1.28.1',
'opentelemetry-api==1.37.0',
'opentelemetry-sdk==1.37.0',
'opentelemetry-exporter-otlp-proto-http==1.37.0',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know where the opentelemetry requirement was coming from that installed 1.40.x? I would've expected that to be handled by pip

# proto-plus<1.24 requires protobuf<5; opentelemetry-proto
# (google-adk) needs protobuf>=5. 1.26.1 allows protobuf<7
# (matches Beam's cap).
'proto-plus>=1.26.1,<2',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the case, we should just put this constraint in the adk portion of the extra and should keep the broader constraint here. This updates the core constraint which will be enforced on all users of beam

Copy link
Copy Markdown
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to merge so that we can get this green/get it on the release branch. I think we can probably simplify this further though. If tensorflow-transform is the source of most of the pain, maybe we can scope it out for now and skip tests (or have a special suite/dependency set for tft only)

'google-adk==1.28.1',
'opentelemetry-api==1.37.0',
'opentelemetry-sdk==1.37.0',
'opentelemetry-exporter-otlp-proto-http==1.37.0',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but what requires opentelemetry-exporter-otlp-proto-http?

Copy link
Copy Markdown
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I noticed https://github.com/apache/beam/actions/runs/24153581426/job/70486866605?pr=38090 is failing because of this. Could you please take a look/fix?

@aIbrahiim aIbrahiim force-pushed the fix-python-yaml-xlang-adk-resolution branch from 6557a06 to 8a74dd8 Compare April 9, 2026 09:18
@aIbrahiim
Copy link
Copy Markdown
Contributor Author

@damccorm the failure in beam_PreCommit_Python_ML looks unrelated to the ADK pin changes as the install step succeeds and tests fail later in Milvus IT setup with pymilvus Fail connecting to server on localhost:46509: so it’s a Milvus container readiness/connectivity issue in py313-ml

@damccorm
Copy link
Copy Markdown
Contributor

damccorm commented Apr 9, 2026

The original failure I linked to was:

The conflict is caused by:
    The user requested tenacity<9 and >=8.0.0
    google-adk 1.28.1 depends on tenacity<10.0.0 and >=9.0.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict

This was clearly an adk issue.

The new set of changes seems to be causing https://github.com/apache/beam/actions/runs/24182541038/job/70578913707 to fail all dataframes tests:

self = <apache_beam.runners.interactive.display.pipeline_graph.PipelineGraph object at 0x13ef82060>
vertex_dict = defaultdict(<class 'dict'>, {'"Create"': {}, 'pcoll5370': {'shape': 'circle', 'label': ''}, '"Map(<lambda at interacti...onymous_pcollection_5363630832': {'shape': 'circle'}, '"PlaceholderExpression[placeholder_DataFrame_5363640192]"': {}})
edge_dict = defaultdict(<class 'dict'>, {('"Create"', 'pcoll5370'): {}, ('pcoll5370', '"Map(<lambda at interactive_runner_test.py:...640192]"'): {}, ('"PlaceholderExpression[placeholder_DataFrame_5363640192]"', 'anonymous_pcollection_5363630832'): {}})
default_vertex_attrs = {'color': 'blue', 'fontcolor': 'blue', 'shape': 'box'}
default_edge_attrs = None

    def _construct_graph(
        self, vertex_dict, edge_dict, default_vertex_attrs, default_edge_attrs):
      """Constructs the pydot.Dot object for the pipeline graph.
    
      Args:
        vertex_dict: (Dict[str, Dict[str, str]]) maps vertex names to attributes
        edge_dict: (Dict[(str, str), Dict[str, str]]) maps vertex name pairs to
            attributes
        default_vertex_attrs: (Dict[str, str]) a dict of attributes
        default_edge_attrs: (Dict[str, str]) a dict of attributes
      """
      with self._lock:
        try:
          pydot.Dot()
        except NameError:
>         raise RuntimeError(
              'pydot is required for pipeline graph generation. '
              'Install it with: pip install pydot')
E         RuntimeError: pydot is required for pipeline graph generation. Install it with: pip install pydot

We need this to be fixed before we can merge

@aIbrahiim aIbrahiim force-pushed the fix-python-yaml-xlang-adk-resolution branch from a899da7 to 61335ff Compare April 9, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants