From ae2916f81c9017b59c924361db66eb3a5368e79e Mon Sep 17 00:00:00 2001 From: Noa Aviel Dove Date: Tue, 12 Nov 2024 20:18:18 -0800 Subject: [PATCH] Fix type warnings in BundleType (#6691) --- .../plugins/repository/tdr_anvil/__init__.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/azul/plugins/repository/tdr_anvil/__init__.py b/src/azul/plugins/repository/tdr_anvil/__init__.py index 72fc3552f6..dce728af63 100644 --- a/src/azul/plugins/repository/tdr_anvil/__init__.py +++ b/src/azul/plugins/repository/tdr_anvil/__init__.py @@ -11,7 +11,6 @@ AbstractSet, Callable, Iterable, - Self, cast, ) import uuid @@ -123,20 +122,19 @@ class enumerates the tables that require special strategies for listing and supplementary = 'anvil_file' duos = 'anvil_dataset' - def is_batched(self: Self | str) -> bool: + @classmethod + def is_batched(cls, table_name: str) -> bool: """ - >>> BundleType.primary.is_batched() + True if bundles for the table of the given name represent batches of + rows, or False if each bundle represents a single row. + + >>> BundleType.is_batched(BundleType.primary.value) False >>> BundleType.is_batched('anvil_activity') True """ - if isinstance(self, str): - try: - self = BundleType(self) - except ValueError: - return True - return self not in (BundleType.primary, BundleType.duos) + return table_name not in (cls.primary.value, cls.duos.value) class TDRAnvilBundleFQIDJSON(SourcedBundleFQIDJSON):