Conversation
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 addresses issues where short BigQuery queries, expected to be stateless, might still result in a job being created, leading to inconsistent Highlights
Changelog
Activity
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
|
There was a problem hiding this comment.
Code Review
The pull request introduces the JobCreationReason enum and integrates it into the BigQueryImpl and TableResult classes. This enhancement allows for better tracking of why a BigQuery job was created, especially in scenarios involving JOB_CREATION_OPTIONAL mode. The integration appears sound, and the updated integration tests (ITBigQueryTest.java) correctly reflect and validate the new functionality, including handling cases where simple queries might still result in job creation with an OTHER reason. The changes are well-contained and address the linked issues effectively.
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobCreationReason.java
Outdated
Show resolved
Hide resolved
| return authType; | ||
| } | ||
| } | ||
| throw new IllegalStateException("Invalid JobCreationReason: " + reason); |
There was a problem hiding this comment.
This would be thrown if a new enum is added in the backend, right? Would it make sense to return an enum like UNKNOWN instead of throwing an exception?
There was a problem hiding this comment.
Ah good point. I removed the exception and used KNOWN AS the default if the mapping doesn't exist.
AIPs suggest that enums shouldn't be changing too much in the future so I don't expect UNKNOWN to be used at all. I think it would be better than having client-side validation if the off chance that there is. Updated!
Fixes: #4105 and #4106