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
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.