Skip to content

Commit ebe8bbd

Browse files
fix wrong file path
1 parent 3eecdad commit ebe8bbd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pyiceberg/io/pyarrow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@
210210

211211
T = TypeVar("T")
212212

213+
def _remove_section_between_at_and_slash(s):
214+
# Remove everything from "@" (inclusive) to the first following "/" (exclusive)
215+
result = re.sub(r'@[^/]+/', '/', s)
216+
return result
213217

214218
@lru_cache
215219
def _cached_resolve_s3_region(bucket: str) -> Optional[str]:
@@ -279,7 +283,7 @@ class PyArrowFile(InputFile, OutputFile):
279283

280284
def __init__(self, location: str, path: str, fs: FileSystem, buffer_size: int = ONE_MEGABYTE):
281285
self._filesystem = fs
282-
self._path = path
286+
self._path = _remove_section_between_at_and_slash(path)
283287
self._buffer_size = buffer_size
284288
super().__init__(location=location)
285289

0 commit comments

Comments
 (0)