Repository navigation
Conversation
c3ecfca to
e89c069
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4415 +/- ##
============================================
+ Coverage 59.71% 59.79% +0.07%
+ Complexity 8384 7944 -440
============================================
Files 1123 1124 +1
Lines 72736 72735 -1
Branches 8852 8851 -1
============================================
+ Hits 43435 43490 +55
+ Misses 26402 26343 -59
- Partials 2899 2902 +3
🚀 New features to boost your workflow:
|
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 introduces support for variable interpolation in import-spec documents, allowing users to dynamically inject runtime values into their configurations. By updating the deserialization logic and providing a whitelist of allowed interpolation paths, the change enables more flexible and reusable job specifications. Additionally, the PR includes robust validation to prevent naming conflicts with reserved keywords and expands the supported data types for interpolation variables. Highlights
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 updates the import-spec dependency to version 1.0.0-rc23 and introduces support for token interpolation within import specifications, allowing dynamic values in BigQuery and HTTP actions as well as BigQuery and text sources. It changes token maps from Map<String, String> to Map<String, Object> to support arbitrary types, adds a custom validator to reserve the variable name 'rows', and cleans up unused code in ModelUtils. The review feedback suggests enhancing robustness by adding null checks in OverlayTokens.tokens() and ModelUtils.replaceVariableTokens() to prevent potential NullPointerExceptions and optimize execution.
This finally brings parity with the legacy job spec format. Users can now both use the import-spec format AND the runtime tokens field available at runtime. Note that runtime tokens are now strictly limited to string, number and boolean values. Moreover, they cannot be named "rows" as this clashes with the pre-reserved Cypher variable "$rows" available in custom query targets. If no runtime token is specified, interpolation is disabled.
e89c069 to
3fb2e9c
Compare
| var httpAction = (HttpAction) actions.get(1); | ||
| assertThat(httpAction.url()).isEqualTo("https://example.com/test_dataset"); | ||
| assertThat(httpAction.getName()).isEqualTo("notify-$dataset"); | ||
| assertThat(httpAction.headers()).containsExactly("X-Dataset", "$dataset"); |
There was a problem hiding this comment.
Shouldn't the header value to check be test_dataset here and not $dataset ? Do we not want to allow interpolation for http headers?
| var tokenName = tokens.next(); | ||
| var rawTokenValue = jsonToken.opt(tokenName); | ||
| var tokenValue = JSONObject.NULL.equals(rawTokenValue) ? null : String.valueOf(rawTokenValue); | ||
| var tokenValue = JSONObject.NULL.equals(rawTokenValue) ? null : rawTokenValue; |
There was a problem hiding this comment.
qq : I hope this will not break serializability promise ?public record OverlayTokens(Map<String, Object> tokens) implements Serializable
sandhyaakula-pr
left a comment
There was a problem hiding this comment.
LGTM, have left a couple of questions though.
|
Please address sandhyaakula-pr's two open questions before merge |
No description provided.