← Back to Pull requests

fix: keep default values of proto3 fields without presence in protobuf ingestion #20485

Closed
unknown closed this pull request without merging on Oct 06, 2026 20:37 UTC
View on GitHub
unknown unknown commented on Oct 06, 2026 02:33 UTC
Author

Fixes #18792.

Description

Protobuf ingestion turned proto3 fields that are not marked optional into null whenever they used their default value (0, "", false, or the first enum value). Users had to wrap such fields in nvl() in transforms to get the actual value back.

ProtobufConverter.convertMessage built each row from Message.getAllFields(). That method only returns fields that are "set", and for proto3 fields without explicit presence a default value is indistinguishable from unset when serialized, so those fields were dropped from the row.

convertMessage now also walks the message descriptor and adds every singular field where FieldDescriptor.hasPresence() is false and which getAllFields() did not already return, using msg.getField() to read the default. This mirrors JsonFormat.printer().alwaysPrintFieldsWithNoPresence(), with one deliberate difference: empty repeated and map fields are still omitted, as before, so they keep ingesting as null rather than an empty array.

Release note

Protobuf ingestion now keeps the default value of proto3 fields that are not marked optional. Previously an int32 field holding 0 (or a string holding "", a bool holding false, an enum holding its first value) was ingested as null. Such fields now ingest as their actual value.

<hr>

This PR has:

  • been self-reviewed.

  • a release note entry in the PR description.

  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • Diff: 207 lines (+155 / -52) across 2 files Reviewer: abhishekrb19 Review duration: 1084m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.36) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 207 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.319
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #20485"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.4% (MEDIUM) · Higher = larger blast radius
    36.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.7% · Safe to merge
    15.7%
    Repository