From 46f709534abd079bfdf0fa1635ee1a3103ae1a94 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Fri, 11 Nov 2022 10:59:50 -0500 Subject: [PATCH] Fix typing error under mypy 0.990 --- dandi/files/_private.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dandi/files/_private.py b/dandi/files/_private.py index c7db67d0e..ebee5915f 100644 --- a/dandi/files/_private.py +++ b/dandi/files/_private.py @@ -1,8 +1,10 @@ from __future__ import annotations +from collections.abc import Mapping from dataclasses import dataclass from enum import Enum from pathlib import Path +from typing import ClassVar import weakref from dandi.consts import ( @@ -14,6 +16,7 @@ from .bases import DandiFile, GenericAsset, LocalAsset, NWBAsset, VideoAsset from .bids import ( + BIDSAsset, BIDSDatasetDescriptionAsset, GenericBIDSAsset, NWBBIDSAsset, @@ -54,7 +57,7 @@ def classify(path: Path) -> DandiFileType: class DandiFileFactory: """:meta private:""" - CLASSES: dict[DandiFileType, type[LocalAsset]] = { + CLASSES: ClassVar[Mapping[DandiFileType, type[LocalAsset]]] = { DandiFileType.NWB: NWBAsset, DandiFileType.ZARR: ZarrAsset, DandiFileType.VIDEO: VideoAsset, @@ -74,7 +77,7 @@ class BIDSFileFactory(DandiFileFactory): bids_dataset_description: BIDSDatasetDescriptionAsset - CLASSES = { + CLASSES: ClassVar[Mapping[DandiFileType, type[BIDSAsset]]] = { DandiFileType.NWB: NWBBIDSAsset, DandiFileType.ZARR: ZarrBIDSAsset, DandiFileType.VIDEO: GenericBIDSAsset,