[yaml] - expand jinja method#38547
Conversation
3139622 to
064f8c2
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #38547 +/- ##
=========================================
Coverage 58.72% 58.73%
Complexity 7418 7418
=========================================
Files 1649 1649
Lines 212354 212415 +61
Branches 6330 6330
=========================================
+ Hits 124712 124763 +51
- Misses 83097 83107 +10
Partials 4545 4545
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:
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for Jinja search paths and comment stripping in Beam YAML templates. Key changes include updating _BeamFileIOLoader to resolve relative paths using provided search paths and implementing strip_leading_comments to handle license headers in templates. Feedback highlights a missing shutil import in the new tests, suggests using os.path.isabs() for cross-platform path validation, and recommends avoiding bare exception handling when loading files.
064f8c2 to
7a9ce50
Compare
Summary of ChangesHello, 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 enhances the YAML pipeline templating system in Apache Beam by improving how Jinja templates are resolved and processed. It introduces a mechanism to handle relative file imports and adds robust handling for leading comments in template files, ensuring that complex YAML configurations can be modularized and parsed correctly. Highlights
New Features🧠 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 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 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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
|
There was a problem hiding this comment.
Code Review
This pull request enhances Beam YAML's Jinja templating by adding support for search paths and improving the handling of files with leading comments, such as license headers. It introduces a strip_leading_comments function and updates _BeamFileIOLoader to resolve relative paths across multiple directories. Feedback was provided regarding the strip_leading_comments implementation, noting that completely removing lines shifts line numbers in error messages; a suggestion was made to replace the content with blank lines to preserve the original line count for better debugging.
|
Assigning reviewers: R: @claudevdm 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). |
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
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.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)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.