palantir / palantir/python-compute-module
[BUG] function_schema_parser does not support new python union types
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Similar to https://github.com/palantir/python-compute-module/issues/50
You can't do this:
@dataclass
class ExternalImageSearchResponse:
result: None | external.ImageSearchResponse
error: None | str
You must do this:
@dataclass
class ExternalImageSearchResponse:
result: Optional[external.ImageSearchResponse]
error: Optional[str]
or the parser throws an exception
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the function_schema_parser entry point and reproduce the exception with the dataclass examples in this issue. Trace how Optional annotations are handled, then verify that the equivalent Python union annotations are accepted without an exception while existing Optional behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100