Skip to content

Commit

Permalink
Spec custom filetype for output
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrandje committed Sep 20, 2023
1 parent 4560c78 commit 83e5a1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cartiflette/download/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ def download_unzip(

if "7-zip" in filetype:
file_locations = datafile.unzip(pattern, ext=ext)
filetype = "SHAPEFILE"
elif "Unicode text" in filetype:
# copy in temp directory without processing
location = tempfile.mkdtemp()
Expand All @@ -770,9 +771,10 @@ def download_unzip(
out.write(f.read())
logger.debug(f"Storing CSV to {location}")
file_locations = (path,)
filetype = "CSV"

else:
raise Exception(f"{filetype} encountered")
raise NotImplementedError(f"{filetype} encountered")
except Exception as e:
raise e
finally:
Expand Down

0 comments on commit 83e5a1a

Please sign in to comment.