From 3128ceee604b45dc3d979e7a9f32ee7e3e52f148 Mon Sep 17 00:00:00 2001 From: Mihir Patel Date: Fri, 17 May 2024 13:48:50 -0400 Subject: [PATCH] fix compression symlink (#3300) --- composer/utils/compression.py | 2 +- tests/utils/test_compression.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/composer/utils/compression.py b/composer/utils/compression.py index 4ebd746820..d9972789bb 100644 --- a/composer/utils/compression.py +++ b/composer/utils/compression.py @@ -22,7 +22,7 @@ def is_compressed_pt(filename: str) -> bool: of a single pt file without a container (like tar). """ parts = filename.split('.') - return len(parts) >= 2 and parts[-2] == 'pt' + return len(parts) >= 2 and parts[-2] == 'pt' and parts[-1] != 'symlink' class CliCompressor: diff --git a/tests/utils/test_compression.py b/tests/utils/test_compression.py index 7518ccab28..d20e2ccc7f 100644 --- a/tests/utils/test_compression.py +++ b/tests/utils/test_compression.py @@ -26,6 +26,7 @@ def test_is_compressed_pt() -> None: assert not is_compressed_pt('') assert not is_compressed_pt('x.lz4') assert not is_compressed_pt('x.tar.lz4') + assert not is_compressed_pt('x.pt.symlink') def test_get_invalid_compressor() -> None: