Remove PipelineEvent.as_dict (#91546)

This commit is contained in:
Erik Montnemery 2023-04-17 16:33:53 +02:00 committed by GitHub
parent 799080eb00
commit 8c1c7e1e4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 15 deletions

View file

@ -85,7 +85,7 @@ class PipelineEventType(StrEnum):
ERROR = "error"
@dataclass
@dataclass(frozen=True)
class PipelineEvent:
"""Events emitted during a pipeline run."""
@ -93,14 +93,6 @@ class PipelineEvent:
data: dict[str, Any] | None = None
timestamp: str = field(default_factory=lambda: dt_util.utcnow().isoformat())
def as_dict(self) -> dict[str, Any]:
"""Return a dict representation of the event."""
return {
"type": self.type,
"timestamp": self.timestamp,
"data": self.data or {},
}
PipelineEventCallback = Callable[[PipelineEvent], None]