Skip to content

Commit 02481b3

Browse files
committed
set file_format and compression to None
1 parent 1274cbc commit 02481b3

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

databusclient/client.py

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,6 @@ def create_distributions_from_metadata(metadata: List[Dict[str, Union[str, int]]
226226
distributions = []
227227
counter = 0
228228

229-
# Known compression extensions
230-
COMPRESSION_EXTS = {"gz", "bz2", "xz", "zip", "7z", "tar", "lz", "zst"}
231-
232229
for entry in metadata:
233230
# Validate required keys
234231
required_keys = ["filename", "checksum", "size", "url"]
@@ -247,32 +244,12 @@ def create_distributions_from_metadata(metadata: List[Dict[str, Union[str, int]]
247244
c in '0123456789abcdefABCDEF' for c in checksum):
248245
raise ValueError(f"Invalid checksum for {filename}")
249246

250-
parts = filename.split(".")
251-
if len(parts) == 1:
252-
file_format = "none"
253-
compression = "none"
254-
elif len(parts) == 2:
255-
file_format = parts[-1]
256-
compression = "none"
257-
else:
258-
# Check if last part is a known compression
259-
if parts[-1] in COMPRESSION_EXTS:
260-
compression = parts[-1]
261-
# Handle compound extensions like .tar.gz
262-
if len(parts) > 2 and parts[-2] in COMPRESSION_EXTS:
263-
file_format = parts[-3] if len(parts) > 3 else "file"
264-
else:
265-
file_format = parts[-2]
266-
else:
267-
file_format = parts[-1]
268-
compression = "none"
269-
270247
distributions.append(
271248
create_distribution(
272249
url=url,
273250
cvs={"count": f"{counter}"},
274-
file_format=file_format,
275-
compression=compression,
251+
file_format=None,
252+
compression=None,
276253
sha256_length_tuple=(checksum, size)
277254
)
278255
)

0 commit comments

Comments
 (0)