potiuk commented on code in PR #36410:
URL: https://github.com/apache/airflow/pull/36410#discussion_r1436422586
##########
airflow/io/path.py:
##########
@@ -173,10 +176,14 @@ def bucket(self) -> str:
@property
def key(self) -> str:
if self._url:
- return self._url.path
+ return self._url.path.lstrip(self.sep)
Review Comment:
I think we should have some flexibility here. There is at least local
filesystem where semantics is different depending on presence or lack of the
leading slash. Specifically for local filesystem it makes a difference:
```
file:///tmp/test.json
```
is different tham:
```
file://tmp/test.json
```
The latter is a file in a `tmp` subfolder in current working directory,
where the former is "/tmp/test.json" starting from the root. I think stripping
behaviour should depend on the filesystem.
##########
airflow/io/path.py:
##########
@@ -173,10 +176,14 @@ def bucket(self) -> str:
@property
def key(self) -> str:
if self._url:
- return self._url.path
+ return self._url.path.lstrip(self.sep)
Review Comment:
I think we should have some flexibility here. There is at least local
filesystem where semantics is different depending on presence or lack of the
leading slash. Specifically for local filesystem it makes a difference:
```
file:///tmp/test.json
```
is different tham:
```
file://tmp/test.json
```
The latter is a file in the `tmp` subfolder in current working directory,
where the former is "/tmp/test.json" starting from the root. I think stripping
behaviour should depend on the filesystem.
--
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]