Skip to content

Commit 5ae2e0d

Browse files
ahsimbckunki
andauthored
#139 Removed archive extension in the BucketPath.as_udf_path (#140)
* Prepare release 0.11.0 * #139 Removed archive extension in as_udf_path * [run-saas-tests] * Update doc/changes/changes_0.11.0.md Co-authored-by: Christoph Kuhnke <github@kuhnke.net> * [run-saas-tests] * [run-saas-tests] --------- Co-authored-by: Christoph Kuhnke <github@kuhnke.net>
1 parent 16d8d3a commit 5ae2e0d

8 files changed

Lines changed: 66 additions & 141 deletions

File tree

doc/changes/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 📝 Changes
22

33
* [unreleased](unreleased.md)
4+
* [0.11.0](changes_0.11.0.md)
45
* [0.10.0](changes_0.10.0.md)
56
* [0.9.0](changes_0.9.0.md)
67
* [0.8.0](changes_0.8.0.md)
@@ -17,6 +18,7 @@
1718
hidden:
1819
---
1920
unreleased
21+
changes_0.11.0
2022
changes_0.10.0
2123
changes_0.9.0
2224
changes_0.8.0

doc/changes/changes_0.11.0.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 0.11.0 - 2024-05-23
2+
3+
## Internal
4+
- Updated lockfile
5+
- Update workflows to align with used exasol-toolbox version (0.12.0)
6+
7+
## Bug Fixes
8+
- #139: Removed archive extension suffix if the path is of an archive in `BucketPath.as_udf_path`

doc/changes/unreleased.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
# Unreleased
2-
3-
## Internal
4-
- Updated lockfile
5-
- Update workflows to align with used exasol-toolbox version (0.12.0)

exasol/bucketfs/_path.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from exasol.bucketfs._service import Service
1010
from exasol.bucketfs._error import BucketFsError
1111

12+
ARCHIVE_SUFFIXES = [".tar", ".gz", ".tgz", ".zip", ".tar"]
13+
1214

1315
class StorageBackend(Enum):
1416
onprem = auto()
@@ -170,6 +172,12 @@ def __truediv__(self, other):
170172
"""
171173

172174

175+
def _remove_archive_suffix(path: PurePath) -> PurePath:
176+
while path.suffix in ARCHIVE_SUFFIXES:
177+
path = path.with_suffix('')
178+
return path
179+
180+
173181
class _BucketFile:
174182
"""
175183
A node in a perceived file structure of a bucket.
@@ -288,7 +296,8 @@ def as_uri(self) -> str:
288296
return self._path.as_uri()
289297

290298
def as_udf_path(self) -> str:
291-
return str(PurePath(self._bucket_api.udf_path) / self._path)
299+
return str(PurePath(self._bucket_api.udf_path) /
300+
_remove_archive_suffix(self._path))
292301

293302
def exists(self) -> bool:
294303
return self._navigate() is not None

exasol/bucketfs/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
# Do not edit this file manually!
66
# If you need to change the version, do so in the project.toml, e.g. by using `poetry version X.Y.Z`.
77
MAJOR = 0
8-
MINOR = 10
8+
MINOR = 11
99
PATCH = 0
1010
VERSION = f"{MAJOR}.{MINOR}.{PATCH}"

0 commit comments

Comments
 (0)