Skip to content

Commit

Permalink
Fix type warnings in BundleType (#6691)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadove-ucsc authored and dsotirho-ucsc committed Nov 25, 2024
1 parent f3ec319 commit c3a5b33
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/azul/plugins/repository/tdr_anvil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
AbstractSet,
Callable,
Iterable,
Self,
cast,
)
import uuid
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit c3a5b33

Please sign in to comment.