ashb commented on code in PR #43893: URL: https://github.com/apache/airflow/pull/43893#discussion_r1837968262
########## task_sdk/src/airflow/sdk/api/datamodels/_generated.py: ########## @@ -0,0 +1,130 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# generated by datamodel-codegen: +# filename: http://0.0.0.0:9091/execution/openapi.json +# version: 0.26.3 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Literal + +from msgspec import Struct, field + + +class ConnectionResponse(Struct): + """ + Connection schema for responses with fields that are needed for Runtime. + """ + + conn_id: str + conn_type: str + host: str | None = None + schema_: str | None = field(name="schema", default=None) + login: str | None = None + password: str | None = None + port: int | None = None + extra: str | None = None + + +class TIEnterRunningPayload(Struct): + """ + Schema for updating TaskInstance to 'RUNNING' state with minimal required fields. + """ + + hostname: str + unixname: str + pid: int + start_date: datetime + state: Literal["running"] | None = "running" + + +class TIHeartbeatInfo(Struct): + """ + Schema for TaskInstance heartbeat endpoint. + """ + + hostname: str + pid: int + + +class State(Enum): + REMOVED = "removed" + SCHEDULED = "scheduled" + QUEUED = "queued" + RUNNING = "running" + RESTARTING = "restarting" + UP_FOR_RETRY = "up_for_retry" + UP_FOR_RESCHEDULE = "up_for_reschedule" + UPSTREAM_FAILED = "upstream_failed" + DEFERRED = "deferred" + + +class TITargetStatePayload(Struct): + """ + Schema for updating TaskInstance to a target state, excluding terminal and running states. + """ + + state: State + + +class State1(Enum): Review Comment: 🤷🏻 - auto generated file based on the OpenAPI spec. We'll look at tweaking these names in the openapi document so these names are better/more stable/predictable soon. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
