uranusjr commented on code in PR #35747:
URL: https://github.com/apache/airflow/pull/35747#discussion_r1398686559
##########
airflow/io/path.py:
##########
@@ -123,20 +120,14 @@ def __new__(cls: type[PT], *args: str | os.PathLike,
**kwargs: typing.Any) -> PT
url = stringify_path(other)
parsed_url: SplitResult = urlsplit(url)
- protocol: str | None = split_protocol(url)[0] or parsed_url.scheme
-
- # allow override of protocol
- protocol = kwargs.get("scheme", protocol)
- for key in ["scheme", "url"]:
- val = kwargs.pop(key, None)
- if val:
- parsed_url = parsed_url._replace(**{key: val})
+ if scheme: # allow override of protocol
+ parsed_url = parsed_url._replace(scheme=scheme)
Review Comment:
I removed `url` since it does not work:
```pycon
>>> from urllib.parse import urlsplit
>>> urlsplit("s3://foo/bar")._replace(url="")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Users/uranusjr/Library/PythonUp/versions/3.12/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/collections/__init__.py",
line 460, in _replace
raise ValueError(f'Got unexpected field names: {list(kwds)!r}')
ValueError: Got unexpected field names: ['url']
```
Let me know if it represents some intention without a correct implementation
so I can add the logic back.
--
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]