Conversation
…or with other languages
Pull request dashboard statusWaiting on reviewers · refreshed 2026-09-23 16:00 UTC Review the latest changes. Also blocked by: Merge conflicts. Status above doesn't look right?
|
JoeyPatricio
left a comment
There was a problem hiding this comment.
Read through the merge logic and the tests. Behavior matches what Java and Go do on conflict (attributes merged, warning, schema_url cleared), with the addition that the cleared state is kept through later merges, which the description calls out. Test cases cover the conflict, the sticky case, and the aggregated-resources path. LGTM.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Equality and hashing omit behaviorally significant conflict state, and the central attribute-merging behavior lacks an independent test.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Updates resource merging to retain attributes while permanently clearing conflicting schema URLs.
Changes:
- Tracks schema URL conflicts across merges.
- Logs conflicts as warnings and expands tests.
- Adds a changelog entry.
| File | Description |
|---|---|
resources/__init__.py |
Implements conflict-aware merging. |
test_resources.py |
Updates merge tests. |
.changelog/5672.added |
Documents the behavior change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


Description
This PR is related to the discussion in the 9/17/26 SIG call regarding handling merging of Resource objects with conflicting schema URLs. The behavior prior to this PR is to drop all attributes for new Resources while merging if the new Resource's schema URL is incompatible with the current Resource's schema URL. This PR updates the SDK's internal resource detector schema URL conflict behavior with other languages. That is, it simply logs a warning and permanently clears the schema URL.
Related to: #2688
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Contrib Repo Change?
Checklist: