Skip to content

Commit d038ac8

Browse files
committed
Fix linting.
1 parent adcd48f commit d038ac8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

datashuttle/utils/folders.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,16 +484,18 @@ def search_with_tags(
484484
)
485485

486486
# Use the helper function to perform the glob search
487+
matching_names: List[str]
488+
487489
if sub:
488-
matching_names: List[str] = search_sub_or_ses_level(
490+
matching_names = search_sub_or_ses_level( # type: ignore
489491
cfg,
490492
base_folder,
491493
local_or_central,
492494
sub,
493495
search_str=search_str,
494496
)[0]
495497
else:
496-
matching_names = search_sub_or_ses_level(
498+
matching_names = search_sub_or_ses_level( # type: ignore
497499
cfg, base_folder, local_or_central, search_str=search_str
498500
)[0]
499501

datashuttle/utils/validation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,15 @@ def format_and_validate_datetime_search_str(
546546
full_tag_regex = (
547547
rf"(\d{{{expected_values}}}){re.escape(tag)}(\d{{{expected_values}}})"
548548
)
549+
549550
match = re.search(full_tag_regex, search_str)
550551

551-
if not match:
552+
if match is None:
552553
utils.log_and_raise_error(
553554
f"Invalid {format_type} range format in search string: {search_str}",
554555
NeuroBlueprintError,
555556
)
557+
assert match is not None, "type narrow `match`"
556558

557559
start_str, end_str = match.groups()
558560

0 commit comments

Comments
 (0)