← Back to issue list

Pydantic warning: PydanticSerializationUnexpectedValue

View original Github issue

Metadata

Project
rockcraft
Number
#1154
Type
issue
State
open
Author
dimaqq
Labels
—
Created
Updated
Closed
—

Current evaluation

Pydantic warns while marshaling projects with an ExecCheck because the tagged Check union cannot obtain a discriminator; a minimal reproducer confirms the dumped data remains correct.

Suggested action: keep open

Reason: The reduction in the March 31 comment reproduces the warning specifically in Project.marshal() when checks contains an ExecCheck, while confirming that the resulting data is still correct. This is a valid, well-scoped serialization defect requiring a regression test and serializer fix; no resolving change is evident in the current tagged Check union.

Evaluated by: mr-cal-bot

Impact: 28 Quick Win: 14 Complexity: 42 Confidence: 92 Actionability: 84

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description Recently I'm getting this additional warning output ### Steps to reproduce `rockcraft pack` ### Environment concierge prepare -p k8s ### rockcraft.yaml ```yaml --- name: gubernator version: 3.0.0 summary: High-performance, distributed rate-limiting service description: | Gubernator is a high-performance, distributed rate-limiting service. license: Apache-2.0 platforms: {amd64: null, arm64: null} base: ubuntu@24.04 parts: go-deps: plugin: nil build-packages: - golang-go gubernator: plugin: go source: https://github.com/gubernator-io/gubernator.git source-type: git # The tip of the v3.0 branch fails the health check # source-branch: v3.0 # A known good revision from v3.0 branch from June 2024 source-commit: 2903b1b566dc9beab322e37ecef4aff50c1a7a97 stage-packages: - ca-certificates after: - go-deps services: gubernator: override: replace startup: enabled command: /bin/gubernator environment: GUBER_TRACING_LEVEL: DEBUG GUBER_HTTP_ADDRESS: 0.0.0.0:80 GUBER_GRPC_ADDRESS: 0.0.0.0:81 on-success: shutdown on-failure: shutdown on-check-failure: online: shutdown checks: online: override: replace exec: # The healthcheck binary is provided by gubernator, it uses same env vars as the daemon command: /bin/healthcheck period: 3s ``` ### Log output ```shell Skipping prime for pebble (already ran)/snap/rockcraft/4238/lib/python3.12/site-packages/pydantic/main.py:464: UserWarning: Pydantic serializer warnings: PydanticSerializationUnexpectedValue(Defaulting to left to right union serialization - failed to get discriminator value for tagged union serialization [input_value=ExecCheck(override='repla...None, working_dir=None)), input_type=ExecCheck]) return self.__pydantic_serializer__.to_python( ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 28
Quick Win: 14
Complexity: 42
Confidence: 92
Actionability: 84
keep open Pydantic warns while marshaling projects with an ExecCheck because the tagged Check union cannot obtain a discriminator; a minimal reproducer confirms the dumped data remains correct.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 19
Complexity: 20
Confidence: 80
Actionability: 80
keep open Pydantic serialization warning during Project.marshal() when checks contain ExecCheck. Reproduced by maintainer; data output is correct but warning is noisy.
qwen/qwen3.8-27b
Impact: 35
Quick Win: 21
Staleness: 45
Complexity: 40
Confidence: 70
Support Request: 10
keep open PydanticSerializationUnexpectedValue warning emitted during Project.marshal() when rockcraft.yaml checks contain an ExecCheck entry. Maintainer reproduced it locally and narrowed it to a tagged-union serialization issue in the Check/ExecCheck model; no fix committed yet.
qwen/qwen3.6-35b-a3b
Staleness: 55
Complexity: 45
Confidence: 85
Support Request: 5
needs triage Unlabelled bug report about a Pydantic v2 serialization warning during rockcraft pack. Reproduced and isolated to Project.marshal() with ExecCheck models, but remains inactive for over 112 days without labels or maintainer assignment.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 30
Confidence: 85
Support Request: 10
keep open Reports a Pydantic serialization warning during rockcraft pack when marshaling ExecCheck objects. A maintainer reproduced it and identified it as a tagged-union serialization warning, but no fix has been implemented yet.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 40
Confidence: 75
Support Request: 10
needs triage Pydantic serialization warning during rockcraft pack when marshalling ExecCheck objects. Reproduced and analyzed by a contributor, but remains unlabelled, unassigned, and inactive for over three months.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.