kaxil commented on code in PR #44843: URL: https://github.com/apache/airflow/pull/44843#discussion_r1881844567
########## task_sdk/src/airflow/sdk/execution_time/comms.py: ########## @@ -170,13 +170,21 @@ class PutVariable(BaseModel): type: Literal["PutVariable"] = "PutVariable" +"""Defines the types that the RTIF payload's dictionary values can take. These are all JsonAble types """ +JsonAbleValueTypes = Union[ + dict[str, JsonValue], + list[JsonValue], + JsonValue, +] + + class SetRenderedFields(BaseModel): """Payload for setting RTIF for a task instance.""" # We are using a BaseModel here compared to server using RootModel because we # have a discriminator running with "type", and RootModel doesn't support type - rendered_fields: dict[str, str | None] + rendered_fields: dict[str, JsonAbleValueTypes] Review Comment: ```suggestion rendered_fields: dict[str, JsonValue] ``` ########## airflow/api_fastapi/execution_api/datamodels/taskinstance.py: ########## @@ -137,5 +137,12 @@ class TaskInstance(BaseModel): map_index: int | None = None +"""Defines the types that the RTIF payload's dictionary values can take. These are all JsonAble types """ +JsonAbleValueTypes = Union[ + dict[str, JsonValue], + list[JsonValue], + JsonValue, +] + """Schema for setting RTIF for a task instance.""" -RTIFPayload = RootModel[dict[str, str]] +RTIFPayload = RootModel[dict[str, JsonAbleValueTypes]] Review Comment: ```suggestion RTIFPayload = RootModel[dict[str, JsonValue]] ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org