-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[Python] Fix AttributeError in ExternalTransform.expand by using get_type_hints() #37299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @Eliaaazzz, 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 resolves a critical Highlights
🧠 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 AssistThe 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
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 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #37299 +/- ##
============================================
+ Coverage 55.16% 55.17% +0.01%
Complexity 1676 1676
============================================
Files 1068 1068
Lines 167257 167342 +85
Branches 1208 1208
============================================
+ Hits 92261 92338 +77
- Misses 72816 72824 +8
Partials 2180 2180
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Assigning reviewers: R: @jrmccluskey for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
…type_hints() (Fixes apache#37289)
8fe6cc6 to
69f022f
Compare
Description
Fixes #37289: Replaces direct access to the internal_type_hintsattribute with the publicget_type_hints()accessor inExternalTransform.expand().Why this is needed
Directly accessing
self._type_hintscauses anAttributeErrorif the type hints have not been explicitly initialized before the expansion phase. This issue was observed specifically when usingStorageWriteToBigQuerywithwith_auto_sharding=True, which triggers anExternalTransformexpansion where_type_hintsis missing.Using
get_type_hints()is the correct, defensive approach as it ensures valid type hints (or an empty instance) are returned, preventing the crash.Testing
StorageWriteToBigQuerywith auto-sharding enabled.AttributeErrorand allows the pipeline to proceed past the expansion phase.Checklist
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, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.