dingo4dev opened a new pull request, #58329: URL: https://github.com/apache/airflow/pull/58329
This pull request adds native Pydantic v2 support for the `ObjectStoragePath` class, enabling seamless validation, serialization, and deserialization with Pydantic models. It introduces custom schema methods and comprehensive tests to ensure robust integration. **Pydantic integration for `ObjectStoragePath`:** * Implemented `__get_pydantic_core_schema__` and `__get_pydantic_json_schema__` methods on `ObjectStoragePath` to provide custom validation, serialization, and JSON schema generation compatible with Pydantic v2. This allows `ObjectStoragePath` to be used as a Pydantic field with full type support. **Testing enhancements:** * Added `TestPydanticSerDe` test class to verify round-trip serialization and deserialization of `ObjectStoragePath` using Pydantic's `TypeAdapter`, including parameterized tests for various path and kwargs combinations. * Introduced `TestPydanticModel`, a Pydantic model using `ObjectStoragePath` as a field, to test model-level serialization/deserialization and ensure compatibility with Pydantic features. closes: #57726 -- 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]
