Merged
Conversation
…olderParams, and DownloadFileURL classes
Preserves the required attribute name - You can keep field as needed Eliminates the runtime error - No more TypeError
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive API documentation and field-level metadata to dataclasses and client methods across the Code Ocean Python SDK to improve usability for AI agents and developers.
- Added class-level docstrings and
metadata={"description": ...}to all dataclass fields. - Enhanced docstrings for client methods in
ComputationsandCapsulesto clarify usage and parameters. - Updated enum classes with descriptive docstrings.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/codeocean/folder.py | Added docstrings and metadata descriptions for folder models |
| src/codeocean/computation.py | Documented dataclasses, enums, and computation client methods |
| src/codeocean/components.py | Added descriptions to permission and search filter models |
| src/codeocean/capsule.py | Documented capsule models, search params, and client methods |
Comments suppressed due to low confidence (3)
src/codeocean/folder.py:19
- The field name
typeshadows Python's built-intype. Consider renaming it toitem_typeor similar to avoid confusion.
type: str = field(
src/codeocean/components.py:131
- The note says only one of
min/maxmust be set, but both fields are non-optional. Either adjust the metadata to reflect both are required or make one optional in the class definition.
"description": "Numeric range filter (only one of min/max must be set)",
src/codeocean/capsule.py:171
- Clarify that
sort_ordershould only be set whensort_fieldis provided, e.g., "Sort order ('asc'or'desc'); only valid whensort_fieldis also specified."
"description": "Sort order ('asc' or 'desc') - must be provided with a sort_field parameter as well!"
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.
This pull request adds comprehensive documentation for every API, dataclass and its fields, and enum, to enable AI agents to use them effectively and to improve the Code Ocean Python SDK developer experience.