chore: Add mypy ignore for union-attr error - #650
Conversation
parthea
left a comment
There was a problem hiding this comment.
This touches generated code. Please could you propose a change in the templates here:
We see the same issue in the generator: googleapis/gapic-generator-python#2410
|
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 |
|
Closing as this change would be reverted in the next code generation PR if we merge it. |
This PR adds
# type: ignore[union-attr]to lines indatastore_v1/services/datastore/client.pyanddatastore_v1/services/datastore/async_client.pythat were causing mypy errors due to potentialNonevalues.This is a temporary measure to unblock other work. The underlying type hint issue is tracked in googleapis/google-cloud-python#15337.