Skip to content

Commit

Permalink
start interface to begin discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Sep 20, 2023
1 parent 87f9b90 commit 7891ea4
Showing 1 changed file with 75 additions and 1 deletion.
76 changes: 75 additions & 1 deletion python_modules/dagster-ext/dagster_ext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,80 @@ def make_channel(
# ########################


class IContext(ABC):
"""Base class for asset context implemented by AssetExecutionContext and ExtContext."""

@property
@abstractmethod
def is_asset_step(self) -> bool:
"""TODO."""

@property
@abstractmethod
def asset_key(self) -> str:
"""TODO."""

@property
@abstractmethod
def asset_keys(self) -> Sequence[str]:
"""TODO."""

@property
@abstractmethod
def provenance(self) -> Optional[ExtDataProvenance]:
"""TODO."""

@property
@abstractmethod
def provenance_by_asset_key(self) -> Mapping[str, Optional[ExtDataProvenance]]:
"""TODO."""

@property
@abstractmethod
def code_version(self) -> Optional[str]:
"""TODO."""

@property
@abstractmethod
def code_version_by_asset_key(self) -> Mapping[str, Optional[str]]:
"""TODO."""

@property
@abstractmethod
def is_partition_step(self) -> bool:
"""TODO."""

@property
@abstractmethod
def partition_key(self) -> str:
"""TODO."""

@property
@abstractmethod
def partition_key_range(self) -> Optional["ExtPartitionKeyRange"]:
"""TODO."""

@property
@abstractmethod
def partition_time_window(self) -> Optional["ExtTimeWindow"]:
"""TODO."""

@property
@abstractmethod
def run_id(self) -> str:
"""TODO."""

@property
@abstractmethod
def job_name(self) -> Optional[str]:
"""TODO."""

@property
@abstractmethod
def retry_number(self) -> int:
"""TODO."""


def init_dagster_ext(
*,
context_loader: Optional[ExtContextLoader] = None,
Expand Down Expand Up @@ -599,7 +673,7 @@ def init_dagster_ext(
return context


class ExtContext:
class ExtContext(IContext):
_instance: ClassVar[Optional["ExtContext"]] = None

@classmethod
Expand Down

0 comments on commit 7891ea4

Please sign in to comment.