Skip to content

Commit

Permalink
type as ModuleType
Browse files Browse the repository at this point in the history
  • Loading branch information
schrockn committed Sep 27, 2023
1 parent f21319f commit 6af1750
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python_modules/dagster/dagster/_utils/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import tempfile
from collections import defaultdict
from contextlib import contextmanager
from types import ModuleType
from typing import Any, Dict, List, Mapping, Optional, Type, cast

# top-level include is dangerous in terms of incurring circular deps
Expand Down Expand Up @@ -330,7 +331,12 @@ def check_concurrency_claim(
return claim_status.with_sleep_interval(float(self._sleep_interval))


def get_all_direct_subclasses_of_marker(marker_interface_cls: Type, module=None) -> List[Type]:
def get_all_direct_subclasses_of_marker(
marker_interface_cls: Type, module: Optional[ModuleType] = None
) -> List[Type]:
"""Get all direct subclasses of a given marker interface class from a given module. If the
module is not specified, it defaults to the dagster module.
"""
if module is None:
import dagster as dagster

Expand Down

0 comments on commit 6af1750

Please sign in to comment.