Skip to content

Commit 35db3ae

Browse files
committed
Fix get_metadata return annotation and import order in misctypes
get_metadata() always returns a dict, never None. The imports in RemoteReadableAsset.open() were not sorted as the pinned isort (5.12.0) of the pre-commit hook expects, so any change to dandi/misctypes.py re-sorted them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
1 parent 8b6a1fc commit 35db3ae

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

‎dandi/metadata/nwb.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
@metadata_cache.memoize_path
3232
def get_metadata(
3333
path: str | Path | Readable, digest: Digest | None = None
34-
) -> dict | None:
34+
) -> dict[str, Any]:
3535
"""
3636
Get "flatdata" from a .nwb file
3737

‎dandi/misctypes.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,8 @@ class RemoteReadableAsset(Readable):
343343

344344
def open(self) -> IO[bytes]:
345345
# Optional dependency:
346-
import fsspec
347-
348346
from aiohttp import ClientTimeout
347+
import fsspec
349348

350349
# We need to call open() on the return value of fsspec.open() because
351350
# otherwise the filehandle will only be opened when used to enter a

0 commit comments

Comments
 (0)