glamorous-ambulance-32929
11/09/2023, 10:23 AMclass CustomActionConfig(BaseModel):
# Whether to print the message in upper case.
to_upper: Optional[bool]
# A basic example of a DataHub action that prints all
# events received to the console.
class CustomAction(Action):
@classmethod
def create(cls, config_dict: dict, ctx: PipelineContext) -> "Action":
action_config = CustomActionConfig.parse_obj(config_dict or {})
return cls(action_config, ctx)
def __init__(self, config: CustomActionConfig, ctx: PipelineContext):
self.config = config
def act(self, event: EventEnvelope) -> None:
print("Custom Action! Received event:")
metadata = event.event
print(json.dumps(<http://metadata.as|metadata.as>_dict(), indent=4))
def close(self) -> None:
pass
Thank you for your helprich-barista-93413
11/13/2023, 8:11 AM