Skip to content

Conversation

@chalmerlowe
Copy link
Contributor

This PR adds # type: ignore[union-attr] to lines in datastore_v1/services/datastore/client.py and datastore_v1/services/datastore/async_client.py that were causing mypy errors due to potential None values.

This is a temporary measure to unblock other work. The underlying type hint issue is tracked in googleapis/google-cloud-python#15337.

@chalmerlowe chalmerlowe requested review from a team as code owners October 31, 2025 13:08
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Oct 31, 2025
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/python-datastore API. label Oct 31, 2025
Copy link
Contributor

@parthea parthea left a comment

Choose a reason for hiding this comment

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

This touches generated code. Please could you propose a change in the templates here:

https://github.com/googleapis/gapic-generator-python/tree/main/gapic/templates/%25namespace/%25name_%25version/%25sub/services/%25service

We see the same issue in the generator: googleapis/gapic-generator-python#2410

@chalmerlowe
Copy link
Contributor Author

chalmerlowe commented Nov 3, 2025

@parthea

Good catch, this does affect generated code.

The two places that seem most relevant are in **/templates/**/_shared_macros.j2 and **/ads-templates/**/_shared_macros.j2.

I am in the middle of trying to get the Python 3.14 updates out the door for as many split repos as I can.

I am not sure I wanna break off from that task right now to change the logic in the GAPIC generator code, but am happy to add a comment based pragma to the generator template, if that is the path we wanna take in the interim..

I notice that it appears someone considered changing the logic in the GAPIC generated code but ditched that attempt. I do not know why. https://github.com/googleapis/gapic-generator-python/pull/2411/files

@parthea
Copy link
Contributor

parthea commented Nov 11, 2025

Closing as this change would be reverted in the next code generation PR if we merge it.

@parthea parthea closed this Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: datastore Issues related to the googleapis/python-datastore API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants