jason810496 commented on code in PR #62701:
URL: https://github.com/apache/airflow/pull/62701#discussion_r2875770868
##########
task-sdk/src/airflow/sdk/io/path.py:
##########
@@ -111,13 +111,21 @@ def __init__(
# override conn_id if explicitly provided
if conn_id is not None:
storage_options["conn_id"] = conn_id
+
+ # pop conn_id before calling super to prevent it from being passed
+ # to the underlying fsspec filesystem, which doesn't understand it
+ self._conn_id = storage_options.pop("conn_id", None)
Review Comment:
I just researched into `UPath` lib
https://github.com/fsspec/universal_pathlib/blob/v0.3.10/upath/extensions.py#L91-L98
```python
@classmethod
def _from_upath(cls, upath: UPath, /) -> Self:
if isinstance(upath, cls):
return upath # type: ignore[unreachable]
else:
obj = object.__new__(cls)
obj.__wrapped__ = upath
return obj
```
that all the `joinpath` like operations involved `_from_upath`.
So overriding `_from_upath` should fix the above behavior.
Additionally, here's definition of `classmethod_or_method`:
```python
class classmethod_or_method(classmethod):
"""A decorator that can be used as a classmethod or an instance method.
When called on the class, it behaves like a classmethod.
When called on an instance, it behaves like an instance method.
"""
def __get__(
self,
instance: T | None,
owner: type[T] | None = None,
/,
) -> Callable[..., T]:
if instance is None:
return self.__func__.__get__(owner)
else:
return self.__func__.__get__(instance)
```
--
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]