fix(core): match AttachmentsProtocol.upload_async to the concrete overloads#1765
Merged
Merged
Conversation
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a type-contract mismatch between uipath-core’s AttachmentsProtocol and the concrete uipath-platform AttachmentsService by redefining upload_async using overloads that match the service’s “content XOR source_path” API. It also adds a conformance test to ensure this structural subtyping relationship (and the runtime-checkable contract) doesn’t regress.
Changes:
- Redefine
AttachmentsProtocol.upload_asyncwith two@overloads (content vs. source_path) aligned toAttachmentsService. - Add a static + runtime conformance test asserting
AttachmentsServicesatisfiesAttachmentsProtocol. - Bump
uipath-coreversion to0.5.23and updateuv.lockfiles accordingly.
Reviewed changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/uipath-core/src/uipath/core/workspace/protocols.py | Adds overloads to AttachmentsProtocol.upload_async to match the concrete service signatures for structural subtyping. |
| packages/uipath-platform/tests/services/test_attachments_service.py | Adds a test that forces mypy to validate structural conformance and also checks the runtime-checkable protocol via isinstance. |
| packages/uipath-core/pyproject.toml | Bumps uipath-core version to 0.5.23. |
| packages/uipath-core/uv.lock | Updates lockfile to reflect uipath-core==0.5.23. |
| packages/uipath-platform/uv.lock | Updates lockfile to reflect uipath-core==0.5.23 in the platform package environment. |
| packages/uipath/uv.lock | Updates lockfile to reflect uipath-core==0.5.23 in the aggregate package environment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vldcmp-uipath
approved these changes
Jun 26, 2026
GabrielVasilescu04
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
AttachmentsProtocol.upload_asyncwith@overloads (content XOR source_path) so the concreteAttachmentsServiceis a structural subtype, not just a runtime_checkable oneAttachmentsServicesatisfiesAttachmentsProtocolWhy
the protocol shipped in #1744 declared a single over-broad
upload_async(bothcontentandsource_pathoptional), which the overloaded concrete service does not structurally satisfy. it surfaced only when a consumer passes the realAttachmentsServiceinto the runtime'sWorkspaceHydrator(mypy error), since the protocol's own tests use a conforming fake. the new conformance test guards against this regressing.