You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ap-- (via GitHub)" <gi...@apache.org> on 2024/01/29 13:10:20 UTC

[I] Update airflow.io.path.ObjectStoragePath for upcoming universal_pathlib release [airflow]

ap-- opened a new issue, #37067:
URL: https://github.com/apache/airflow/issues/37067

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I'm opening this issue to track a needed refactor of `airflow.io.path.ObjectStoragePath` to support the next release of `universal_pathlib` without having to have a special implementation for Python-3.12
   
   ### What you think should happen instead?
   
   Tagging @bolkedebruin, @uranusjr, @potiuk 
   
   It would be great if I could have some insight into the intended behaviour for the custom `UPath` subclass `airflow.io.path.ObjectStoragePath`
   
   Looking at the current implementation it seems that these are the intended changes:
   
   - (1) extracting a connection ID from the URI https://github.com/apache/airflow/blob/07fd3646fa765859a152731bf135ea944d0753d7/airflow/io/path.py#L148-L151
   - (2) delegating fsspec filesystem creation to `airflow.io.store.ObjectStore` https://github.com/apache/airflow/blob/07fd3646fa765859a152731bf135ea944d0753d7/airflow/io/path.py#L49-L65
   - (3) customization and extension of the `UPath` interface with several custom methods.
   
   I am working on supporting (1) and (2) via custom methods that can be overwritten in UPath subclasses, and allow to have a single implementation for python versions prior to 3.12 and 3.12+, see: fsspec/universal_pathlib#172
   
   Once that is integrated in UPath it should simplify the `ObjectStoragePath` implementation a lot. The custom accessor will be replaced by a factory method for creating fsspec filesystems, and the custom `__new__` implementation by a method for parsing additional storage_options.
   
   Let me know if that sounds good, and what's the best way to collaborate on this issue and move forward.
   
   
   Cheers,
   Andreas 😃 
   
   ### How to reproduce
   
   N/A
   
   ### Operating System
   
   N/A
   
   ### Versions of Apache Airflow Providers
   
   ---
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   N/A
   
   ### Anything else?
   
   N/A
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Update airflow.io.path.ObjectStoragePath for upcoming universal_pathlib release [airflow]

Posted by "bolkedebruin (via GitHub)" <gi...@apache.org>.
bolkedebruin commented on issue #37067:
URL: https://github.com/apache/airflow/issues/37067#issuecomment-1914980481

   Hey @ap-- , 
   
   That just sounds awesome! Obviously any simplification while retaining flexibility sounds great. 
   
   The generic need for a custom class on top of UPath is indeed to support Airflow-isms, like what you mentioned but also to be able to de/serialize a path into something that can be stored in a database. We are also a bit more "object store" oriented (semantically) than UPath I guess, so a little bit more strict in what we support how how things behave. 
   
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Update airflow.io.path.ObjectStoragePath for upcoming universal_pathlib release [airflow]

Posted by "ap-- (via GitHub)" <gi...@apache.org>.
ap-- commented on issue #37067:
URL: https://github.com/apache/airflow/issues/37067#issuecomment-1976787952

   @bolkedebruin I released a new version of universal_pathlib yesterday, that vendors the required code to delay import of the required fsspec filesystems until they are actually used for IO.
   
   PR #37524 should in theory pass all tests now, if `universal_pathlib>=0.2.2` is used as a dependency.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Update airflow.io.path.ObjectStoragePath for upcoming universal_pathlib release [airflow]

Posted by "ap-- (via GitHub)" <gi...@apache.org>.
ap-- commented on issue #37067:
URL: https://github.com/apache/airflow/issues/37067#issuecomment-1919177417

   > The generic need for a custom class on top of UPath is indeed to support Airflow-isms, like what you mentioned but also to be able to de/serialize a path into something that can be stored in a database. We are also a bit more "object store" oriented (semantically) than UPath I guess, so a little bit more strict in what we support how how things behave.
   
   Great 👍  Once I finish the implementation for fsspec/universal_pathlib#173 I'll open a PR here.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Update airflow.io.path.ObjectStoragePath for upcoming universal_pathlib release [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #37067:
URL: https://github.com/apache/airflow/issues/37067#issuecomment-1944548361

   Last blocker for https://github.com/apache/airflow/pull/36755


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Update airflow.io.path.ObjectStoragePath for upcoming universal_pathlib release [airflow]

Posted by "bolkedebruin (via GitHub)" <gi...@apache.org>.
bolkedebruin closed issue #37067: Update airflow.io.path.ObjectStoragePath for upcoming universal_pathlib release
URL: https://github.com/apache/airflow/issues/37067


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Update airflow.io.path.ObjectStoragePath for upcoming universal_pathlib release [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #37067:
URL: https://github.com/apache/airflow/issues/37067#issuecomment-1914666408

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org