Skip to content

[ruby-compat/10] Add source_format/compression validation and fix project_id extraction bug - #120

Closed
chikamura wants to merge 3 commits into
feature/ruby-compatibilityfrom
ruby-compat/10-config-validation
Closed

chikamura wants to merge 3 commits into
feature/ruby-compatibilityfrom
ruby-compat/10-config-validation

Conversation

@chikamura

Copy link
Copy Markdown
Contributor

Summary

  • Ruby's configure() validates source_format/compression (normalizing case, accepting JSONL as an alias for
    NEWLINE_DELIMITED_JSON) and rejects anything else. Java had no such validation. Add
    validateSourceFormat/validateCompression to BigqueryConfigValidator.
  • validateTimePartitioning was defined but never wired into validate(); fix that dead-code bug.
  • Fix a real bug in BigqueryClient#getProjectIdFromJsonKeyfile(): it used JSONObject#getString, which throws
    JSONException instead of returning null when project_id is missing, making the intended ConfigException
    unreachable. Switch to optString so the existing null check works as intended.
  • Add AuthTest covering the auth_method/json_keyfile/workload_identity_federation checks ported from ruby's
    configure(), which previously had no test coverage, plus BigqueryClient constructor tests for the
    missing-project/missing-project_id cases.

Test plan

  • ./gradlew test
  • ./gradlew spotlessApply

🤖 Generated with Claude Code

chikamura and others added 2 commits September 17, 2026 14:44
Normalize source_format (with JSONL alias) and compression values and
reject anything outside BigQuery's supported set, matching ruby's
configure(). Also wire validateTimePartitioning into validate(), which
was previously defined but never invoked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
getProjectIdFromJsonKeyfile() used JSONObject#getString, which throws
JSONException instead of returning null when project_id is missing,
making the intended ConfigException unreachable. Switch to optString so
the existing null check works as intended.

Also add tests covering the auth_method/json_keyfile/
workload_identity_federation/project checks ported from ruby's
configure(), which previously had no coverage.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chikamura
chikamura changed the base branch from master to feature/ruby-compatibility September 25, 2026 03:38
@chikamura
chikamura marked this pull request as ready for review September 29, 2026 01:21
@chikamura chikamura changed the title [WIP][ruby-compat/10] Add source_format/compression validation and fix project_id extraction bug [ruby-compat/10] Add source_format/compression validation and fix project_id extraction bug Sep 29, 2026
@chikamura chikamura closed this Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant