Remove PipelineEvent.as_dict (#91546)
This commit is contained in:
parent
799080eb00
commit
8c1c7e1e4c
5 changed files with 7 additions and 15 deletions
|
@ -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]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue