chitralverma commented on PR #6720: URL: https://github.com/apache/opendal/pull/6720#issuecomment-3428612413
@Xuanwo final one for stubs for your review, whenever you're free. --- ## Copilot Summary: This pull request refines the Python bindings for OpenDAL, focusing on improved documentation, more accurate type stubs, and consistent module organization. The most significant changes include enhanced docstrings and type annotations for the `File` and `AsyncFile` classes, the addition of a new `PresignedRequest` type, and updates to documentation and configuration files to reflect these improvements. ### Python API improvements * Added comprehensive docstrings and accurate type annotations to the `File` and `AsyncFile` classes in `file.pyi`, making their usage and behavior clearer for users. Methods now include detailed parameter and return type documentation. * Updated the implementation and Python stub generation for the `File` class in `src/file.rs`, including improved docstrings, type overrides, and method signatures to match Python conventions and enhance usability. [[1]](diffhunk://#diff-c51313e6a250fa340ac1ef4a445b19c477d7d6f8c0ed34b8ed75f66dd8f7ec76L39-R43) [[2]](diffhunk://#diff-c51313e6a250fa340ac1ef4a445b19c477d7d6f8c0ed34b8ed75f66dd8f7ec76R62-R79) [[3]](diffhunk://#diff-c51313e6a250fa340ac1ef4a445b19c477d7d6f8c0ed34b8ed75f66dd8f7ec76L104-R139) [[4]](diffhunk://#diff-c51313e6a250fa340ac1ef4a445b19c477d7d6f8c0ed34b8ed75f66dd8f7ec76L149-R196) [[5]](diffhunk://#diff-c51313e6a250fa340ac1ef4a445b19c477d7d6f8c0ed34b8ed75f66dd8f7ec76L184-R244) [[6]](diffhunk://#diff-c51313e6a250fa340ac1ef4a445b19c477d7d6f8c0ed34b8ed75f66dd8f7ec76L206-R278) [[7]](diffhunk://#diff-c51313e6a250fa340ac1ef4a445b19c477d7d6f8c0ed34b8ed75f66dd8f7ec76L248-R317) [[8]](diffhunk://#diff-c51313e6a250fa340ac1ef4a445b19c477d7d6f8c0ed34b8ed75f66dd8f7ec76R338-R344) ### New types and documentation * Introduced the `PresignedRequest` type to the Python bindings, including its stub and documentation, allowing users to access presigned request details such as URL, method, and headers. [[1]](diffhunk://#diff-4a0e7a71830566e3d4d7aaf1b5e4985b293ddaa1628f4373cb92de95786b7570R102-R127) [[2]](diffhunk://#diff-9b08c269b303497db2c61fe56293da5fbda9011aea719ddb02038dffb8236d41L6-R30) * Updated API documentation files to reflect the new module structure (e.g., `opendal.file.File` instead of `opendal.File`) and added documentation for the new `PresignedRequest` type. [[1]](diffhunk://#diff-d9dcd0b56150aeacd93d0ca312608fe40b62a5e8826fd4f6078204f00d207c3eL1-R3) [[2]](diffhunk://#diff-e88bee734f0acf409aaaacaa543b3d0e49a8982b20001651865612c56c7373d5L1-R3) [[3]](diffhunk://#diff-4975b089774c5f6b5d1a3ff0a1a50829a4df0c4ef5495174c2e45fa0e9ef1abfL1-R3) [[4]](diffhunk://#diff-9b08c269b303497db2c61fe56293da5fbda9011aea719ddb02038dffb8236d41L6-R30) ### Layer class docstring improvements * Improved docstrings for layer classes (`ConcurrentLimitLayer`, `MimeGuessLayer`, `RetryLayer`, and `Layer`) in `layers.pyi` to provide clearer descriptions of their functionality and usage. [[1]](diffhunk://#diff-68894cfdafd23d8df0f898ab33f4124d798df269ef86af4f7448798870b5ca28L27-R27) [[2]](diffhunk://#diff-68894cfdafd23d8df0f898ab33f4124d798df269ef86af4f7448798870b5ca28L54-R57) [[3]](diffhunk://#diff-68894cfdafd23d8df0f898ab33f4124d798df269ef86af4f7448798870b5ca28L94-L95) ### Configuration and dependency updates * Bumped the `pyo3-stub-gen` dependency version from `0.15` to `0.16` in `Cargo.toml` to ensure compatibility with the latest stub generation features. * Updated `pyrightconfig.json` and `ruff.toml` to adjust linting and type checking behavior for `.pyi` files, reflecting the expanded use of type annotations. [[1]](diffhunk://#diff-20256f97d0498ffbc5c09d8a2ddf03dec2a7b53d291a4f2117ad35127d589fc1L5-R6) [[2]](diffhunk://#diff-da14b387e98883d0ff8a6d8b5ddda3a3831803a18e9a2cb9bb17dc336d8213beL76-R76) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
