exasol / bucketfs-python

BucketFS utilities for the Python programming language
https://exasol.github.io/bucketfs-python
MIT License
1 stars 1 forks source link

Remove archive extension from the file name in the BucketPath.as_udf_path function #139

Closed ahsimb closed 3 months ago

ahsimb commented 3 months ago

An archive gets extracted in the subdirectory visible to a UDF. Therefore, when constructing its path in the as_udf_path function, the archive's extension should be removed, as in the code below.

ARCHIVE_EXTENSIONS = [".tar.gz", ".tgz", ".zip", ".tar"]

for extension in ARCHIVE_EXTENSIONS:
    if bucket_file.endswith(extension):
        bucket_file = bucket_file[: -len(extension)]
        break