Nataneljpwd commented on code in PR #52002:
URL: https://github.com/apache/airflow/pull/52002#discussion_r2184918871
##########
task-sdk/src/airflow/sdk/io/path.py:
##########
@@ -84,6 +87,41 @@ class ObjectStoragePath(CloudPath):
__slots__ = ("_hash_cached",)
+ @classmethod
+ def from_conn(cls, conn: Connection) -> ObjectStoragePath:
+ """
+ Construct an ObjectStoragePath from an Airflow Connection.
+
+ This method expects with following keys to be present in its 'extra'
JSON configuration:
+
+ - "provider": the scheme or protocol (e.g., "s3", "gs", "file") as
known by fsspec
+ - "base_path": the base bucket, container, or directory (e.g.,
"my-bucket", "tmp/export")
+
+ The final URI is assembled as: <provider>://<base_path>, and passed to
ObjectStoragePath.
+
+ :param conn: Airflow Connection object
+ :return: ObjectStoragePath instance
+ :raises ValueError: if the connection type is not `objectstore`
Review Comment:
Update this comment to reflect the behavior
--
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]