This is an automated email from the ASF dual-hosted git repository.
jason810496 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new c6e19e63a75 Fix supervisor schema snapshot so go model generation
works (#73531)
c6e19e63a75 is described below
commit c6e19e63a751c4e933f5e71e7dd10019f3efdf47
Author: Amogh Desai <[email protected]>
AuthorDate: Tue Sep 22 16:19:19 2026 +0530
Fix supervisor schema snapshot so go model generation works (#73531)
---
go-sdk/pkg/execution/genmodels/defaults.gen.go | 85 +--------
go-sdk/pkg/execution/genmodels/models.gen.go | 203 +++++++++++----------
scripts/ci/prek/dump_supervisor_schemas.py | 12 ++
.../airflow/sdk/execution_time/schema/schema.json | 12 +-
ts-sdk/src/generated/supervisor.ts | 30 +--
5 files changed, 150 insertions(+), 192 deletions(-)
diff --git a/go-sdk/pkg/execution/genmodels/defaults.gen.go
b/go-sdk/pkg/execution/genmodels/defaults.gen.go
index a4e9b121282..81b2715ebf1 100644
--- a/go-sdk/pkg/execution/genmodels/defaults.gen.go
+++ b/go-sdk/pkg/execution/genmodels/defaults.gen.go
@@ -23,23 +23,10 @@ import "github.com/vmihailenco/msgpack/v5"
// DecodeMsgpack applies AwaitInputTask's schema defaults that msgpack would
otherwise skip.
func (m *AwaitInputTask) DecodeMsgpack(dec *msgpack.Decoder) error {
type alias AwaitInputTask
- v := alias{}
- // Decode once into raw bytes so a nullable default applies only on an
absent
- // wire key, never overwriting an explicit null (both decode to nil).
- var raw msgpack.RawMessage
- if err := dec.Decode(&raw); err != nil {
- return err
- }
- if err := msgpack.Unmarshal(raw, &v); err != nil {
- return err
- }
- var present map[string]msgpack.RawMessage
- if err := msgpack.Unmarshal(raw, &present); err != nil {
+ v := alias{State: "awaiting_input"}
+ if err := dec.Decode(&v); err != nil {
return err
}
- if _, ok := present["state"]; !ok {
- v.State = "awaiting_input"
- }
*m = AwaitInputTask(v)
return nil
}
@@ -119,23 +106,10 @@ func (m *DagRunResult) DecodeMsgpack(dec
*msgpack.Decoder) error {
// DecodeMsgpack applies DeferTask's schema defaults that msgpack would
otherwise skip.
func (m *DeferTask) DecodeMsgpack(dec *msgpack.Decoder) error {
type alias DeferTask
- v := alias{}
- // Decode once into raw bytes so a nullable default applies only on an
absent
- // wire key, never overwriting an explicit null (both decode to nil).
- var raw msgpack.RawMessage
- if err := dec.Decode(&raw); err != nil {
- return err
- }
- if err := msgpack.Unmarshal(raw, &v); err != nil {
- return err
- }
- var present map[string]msgpack.RawMessage
- if err := msgpack.Unmarshal(raw, &present); err != nil {
+ v := alias{State: "deferred"}
+ if err := dec.Decode(&v); err != nil {
return err
}
- if _, ok := present["state"]; !ok {
- v.State = "deferred"
- }
*m = DeferTask(v)
return nil
}
@@ -213,23 +187,10 @@ func (m *PreviousTIResponse) DecodeMsgpack(dec
*msgpack.Decoder) error {
// DecodeMsgpack applies RescheduleTask's schema defaults that msgpack would
otherwise skip.
func (m *RescheduleTask) DecodeMsgpack(dec *msgpack.Decoder) error {
type alias RescheduleTask
- v := alias{}
- // Decode once into raw bytes so a nullable default applies only on an
absent
- // wire key, never overwriting an explicit null (both decode to nil).
- var raw msgpack.RawMessage
- if err := dec.Decode(&raw); err != nil {
- return err
- }
- if err := msgpack.Unmarshal(raw, &v); err != nil {
- return err
- }
- var present map[string]msgpack.RawMessage
- if err := msgpack.Unmarshal(raw, &present); err != nil {
+ v := alias{State: "up_for_reschedule"}
+ if err := dec.Decode(&v); err != nil {
return err
}
- if _, ok := present["state"]; !ok {
- v.State = "up_for_reschedule"
- }
*m = RescheduleTask(v)
return nil
}
@@ -237,23 +198,10 @@ func (m *RescheduleTask) DecodeMsgpack(dec
*msgpack.Decoder) error {
// DecodeMsgpack applies RetryTask's schema defaults that msgpack would
otherwise skip.
func (m *RetryTask) DecodeMsgpack(dec *msgpack.Decoder) error {
type alias RetryTask
- v := alias{}
- // Decode once into raw bytes so a nullable default applies only on an
absent
- // wire key, never overwriting an explicit null (both decode to nil).
- var raw msgpack.RawMessage
- if err := dec.Decode(&raw); err != nil {
- return err
- }
- if err := msgpack.Unmarshal(raw, &v); err != nil {
- return err
- }
- var present map[string]msgpack.RawMessage
- if err := msgpack.Unmarshal(raw, &present); err != nil {
+ v := alias{State: "up_for_retry"}
+ if err := dec.Decode(&v); err != nil {
return err
}
- if _, ok := present["state"]; !ok {
- v.State = "up_for_retry"
- }
*m = RetryTask(v)
return nil
}
@@ -261,23 +209,10 @@ func (m *RetryTask) DecodeMsgpack(dec *msgpack.Decoder)
error {
// DecodeMsgpack applies SucceedTask's schema defaults that msgpack would
otherwise skip.
func (m *SucceedTask) DecodeMsgpack(dec *msgpack.Decoder) error {
type alias SucceedTask
- v := alias{}
- // Decode once into raw bytes so a nullable default applies only on an
absent
- // wire key, never overwriting an explicit null (both decode to nil).
- var raw msgpack.RawMessage
- if err := dec.Decode(&raw); err != nil {
- return err
- }
- if err := msgpack.Unmarshal(raw, &v); err != nil {
- return err
- }
- var present map[string]msgpack.RawMessage
- if err := msgpack.Unmarshal(raw, &present); err != nil {
+ v := alias{State: "success"}
+ if err := dec.Decode(&v); err != nil {
return err
}
- if _, ok := present["state"]; !ok {
- v.State = "success"
- }
*m = SucceedTask(v)
return nil
}
diff --git a/go-sdk/pkg/execution/genmodels/models.gen.go
b/go-sdk/pkg/execution/genmodels/models.gen.go
index 76978294817..698f6c097f3 100644
--- a/go-sdk/pkg/execution/genmodels/models.gen.go
+++ b/go-sdk/pkg/execution/genmodels/models.gen.go
@@ -175,7 +175,7 @@ type AssetStateStoreResult struct {
Type string `msgpack:"type,omitempty"`
// Value corresponds to the JSON schema field "value".
- Value JsonValue `msgpack:"value"`
+ Value interface{} `msgpack:"value"`
}
// Response to GetAssetsByAlias; list of concrete assets resolved from an
alias.
@@ -202,7 +202,7 @@ type AwaitInputTask struct {
RenderedMapIndex interface{} `msgpack:"rendered_map_index,omitempty"`
// State corresponds to the JSON schema field "state".
- State interface{} `msgpack:"state,omitempty"`
+ State string `msgpack:"state,omitempty"`
// Timeout corresponds to the JSON schema field "timeout".
Timeout interface{} `msgpack:"timeout,omitempty"`
@@ -284,22 +284,22 @@ type ConnectionResult struct {
ConnType string `msgpack:"conn_type"`
// Extra corresponds to the JSON schema field "extra".
- Extra interface{} `msgpack:"extra,omitempty"`
+ Extra interface{} `msgpack:"extra"`
// Host corresponds to the JSON schema field "host".
- Host interface{} `msgpack:"host,omitempty"`
+ Host interface{} `msgpack:"host"`
// Login corresponds to the JSON schema field "login".
- Login interface{} `msgpack:"login,omitempty"`
+ Login interface{} `msgpack:"login"`
// Password corresponds to the JSON schema field "password".
- Password interface{} `msgpack:"password,omitempty"`
+ Password interface{} `msgpack:"password"`
// Port corresponds to the JSON schema field "port".
- Port interface{} `msgpack:"port,omitempty"`
+ Port interface{} `msgpack:"port"`
// Schema corresponds to the JSON schema field "schema".
- Schema interface{} `msgpack:"schema,omitempty"`
+ Schema interface{} `msgpack:"schema"`
// Type corresponds to the JSON schema field "type".
Type string `msgpack:"type,omitempty"`
@@ -425,10 +425,10 @@ type DagFileParsingResult struct {
type DagResult struct {
// BundleName corresponds to the JSON schema field "bundle_name".
- BundleName interface{} `msgpack:"bundle_name,omitempty"`
+ BundleName interface{} `msgpack:"bundle_name"`
// BundleVersion corresponds to the JSON schema field "bundle_version".
- BundleVersion interface{} `msgpack:"bundle_version,omitempty"`
+ BundleVersion interface{} `msgpack:"bundle_version"`
// DagID corresponds to the JSON schema field "dag_id".
DagID string `msgpack:"dag_id"`
@@ -437,13 +437,13 @@ type DagResult struct {
IsPaused bool `msgpack:"is_paused"`
// NextDagrun corresponds to the JSON schema field "next_dagrun".
- NextDagrun interface{} `msgpack:"next_dagrun,omitempty"`
+ NextDagrun interface{} `msgpack:"next_dagrun"`
// Owners corresponds to the JSON schema field "owners".
- Owners interface{} `msgpack:"owners,omitempty"`
+ Owners interface{} `msgpack:"owners"`
// RelativeFileloc corresponds to the JSON schema field
"relative_fileloc".
- RelativeFileloc interface{} `msgpack:"relative_fileloc,omitempty"`
+ RelativeFileloc interface{} `msgpack:"relative_fileloc"`
// Tags corresponds to the JSON schema field "tags".
Tags []string `msgpack:"tags"`
@@ -516,25 +516,25 @@ type DagRunAssetReference struct {
DagID string `msgpack:"dag_id"`
// DataIntervalEnd corresponds to the JSON schema field
"data_interval_end".
- DataIntervalEnd interface{} `msgpack:"data_interval_end,omitempty"`
+ DataIntervalEnd interface{} `msgpack:"data_interval_end"`
// DataIntervalStart corresponds to the JSON schema field
"data_interval_start".
- DataIntervalStart interface{} `msgpack:"data_interval_start,omitempty"`
+ DataIntervalStart interface{} `msgpack:"data_interval_start"`
// EndDate corresponds to the JSON schema field "end_date".
- EndDate interface{} `msgpack:"end_date,omitempty"`
+ EndDate interface{} `msgpack:"end_date"`
// LogicalDate corresponds to the JSON schema field "logical_date".
- LogicalDate interface{} `msgpack:"logical_date,omitempty"`
+ LogicalDate interface{} `msgpack:"logical_date"`
// PartitionKey corresponds to the JSON schema field "partition_key".
- PartitionKey interface{} `msgpack:"partition_key,omitempty"`
+ PartitionKey interface{} `msgpack:"partition_key"`
// RunID corresponds to the JSON schema field "run_id".
RunID string `msgpack:"run_id"`
// StartDate corresponds to the JSON schema field "start_date".
- StartDate time.Time `msgpack:"start_date"`
+ StartDate interface{} `msgpack:"start_date"`
// State corresponds to the JSON schema field "state".
State string `msgpack:"state"`
@@ -564,16 +564,16 @@ type DagRunResult struct {
DagID string `msgpack:"dag_id"`
// DataIntervalEnd corresponds to the JSON schema field
"data_interval_end".
- DataIntervalEnd interface{} `msgpack:"data_interval_end,omitempty"`
+ DataIntervalEnd interface{} `msgpack:"data_interval_end"`
// DataIntervalStart corresponds to the JSON schema field
"data_interval_start".
- DataIntervalStart interface{} `msgpack:"data_interval_start,omitempty"`
+ DataIntervalStart interface{} `msgpack:"data_interval_start"`
// EndDate corresponds to the JSON schema field "end_date".
- EndDate interface{} `msgpack:"end_date,omitempty"`
+ EndDate interface{} `msgpack:"end_date"`
// LogicalDate corresponds to the JSON schema field "logical_date".
- LogicalDate interface{} `msgpack:"logical_date,omitempty"`
+ LogicalDate interface{} `msgpack:"logical_date"`
// Note corresponds to the JSON schema field "note".
Note interface{} `msgpack:"note,omitempty"`
@@ -582,7 +582,7 @@ type DagRunResult struct {
PartitionDate interface{} `msgpack:"partition_date,omitempty"`
// PartitionKey corresponds to the JSON schema field "partition_key".
- PartitionKey interface{} `msgpack:"partition_key,omitempty"`
+ PartitionKey interface{} `msgpack:"partition_key"`
// RunAfter corresponds to the JSON schema field "run_after".
RunAfter time.Time `msgpack:"run_after"`
@@ -594,7 +594,7 @@ type DagRunResult struct {
RunType DagRunType `msgpack:"run_type"`
// StartDate corresponds to the JSON schema field "start_date".
- StartDate interface{} `msgpack:"start_date,omitempty"`
+ StartDate interface{} `msgpack:"start_date"`
// State corresponds to the JSON schema field "state".
State DagRunState `msgpack:"state"`
@@ -656,7 +656,7 @@ type DeferTask struct {
RenderedMapIndex interface{} `msgpack:"rendered_map_index,omitempty"`
// State corresponds to the JSON schema field "state".
- State interface{} `msgpack:"state,omitempty"`
+ State string `msgpack:"state,omitempty"`
// TriggerKwargs corresponds to the JSON schema field "trigger_kwargs".
TriggerKwargs *TriggerKwargs `msgpack:"trigger_kwargs,omitempty"`
@@ -1301,7 +1301,7 @@ type MaskSecret struct {
Value JsonValue `msgpack:"value"`
}
-type NextKwargs map[string]JsonValue
+type NextKwargs map[string]interface{}
type OKResponse struct {
// Ok corresponds to the JSON schema field "ok".
@@ -1410,7 +1410,7 @@ type RescheduleTask struct {
RescheduleDate time.Time `msgpack:"reschedule_date"`
// State corresponds to the JSON schema field "state".
- State interface{} `msgpack:"state,omitempty"`
+ State string `msgpack:"state,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `msgpack:"type,omitempty"`
@@ -1436,7 +1436,7 @@ type RetryTask struct {
RetryReason interface{} `msgpack:"retry_reason,omitempty"`
// State corresponds to the JSON schema field "state".
- State interface{} `msgpack:"state,omitempty"`
+ State string `msgpack:"state,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `msgpack:"type,omitempty"`
@@ -1592,7 +1592,7 @@ type SucceedTask struct {
RenderedMapIndex interface{} `msgpack:"rendered_map_index,omitempty"`
// State corresponds to the JSON schema field "state".
- State interface{} `msgpack:"state,omitempty"`
+ State string `msgpack:"state,omitempty"`
// TaskOutlets corresponds to the JSON schema field "task_outlets".
TaskOutlets *TaskOutlets `msgpack:"task_outlets,omitempty"`
@@ -1649,51 +1649,19 @@ type TIRunContext struct {
type TaskArgBinding interface{}
-type TaskBreadcrumbsResult struct {
- // Breadcrumbs corresponds to the JSON schema field "breadcrumbs".
- Breadcrumbs []TaskBreadcrumbsResultBreadcrumbsElem
`msgpack:"breadcrumbs"`
-
- // Type corresponds to the JSON schema field "type".
- Type string `msgpack:"type,omitempty"`
-}
-
-type TaskBreadcrumbsResultBreadcrumbsElem map[string]interface{}
-
-// Task callback status information.
-//
-// A Class with information about the success/failure TI callback to be
executed.
-// Currently, only failure
-// callbacks when tasks are externally killed or experience heartbeat timeouts
are
-// run via DagFileProcessorProcess.
-type TaskCallbackRequest struct {
- // BundleName corresponds to the JSON schema field "bundle_name".
- BundleName string `msgpack:"bundle_name"`
+type TriggerKwargs map[string]interface{}
- // BundleVersion corresponds to the JSON schema field "bundle_version".
- BundleVersion interface{} `msgpack:"bundle_version"`
-
- // ContextFromServer corresponds to the JSON schema field
"context_from_server".
- ContextFromServer *TIRunContext
`msgpack:"context_from_server,omitempty"`
-
- // Filepath corresponds to the JSON schema field "filepath".
- Filepath string `msgpack:"filepath"`
-
- // Msg corresponds to the JSON schema field "msg".
- Msg interface{} `msgpack:"msg,omitempty"`
-
- // TaskCallbackType corresponds to the JSON schema field
"task_callback_type".
- TaskCallbackType interface{} `msgpack:"task_callback_type,omitempty"`
-
- // TI corresponds to the JSON schema field "ti".
- TI TaskInstance `msgpack:"ti"`
-
- // Type corresponds to the JSON schema field "type".
- Type string `msgpack:"type,omitempty"`
+// Variable schema for responses with fields that are needed for Runtime.
+type VariableResponse struct {
+ // Key corresponds to the JSON schema field "key".
+ Key string `msgpack:"key"`
- // VersionData corresponds to the JSON schema field "version_data".
- VersionData *VersionData `msgpack:"version_data,omitempty"`
+ // Value corresponds to the JSON schema field "value".
+ Value interface{} `msgpack:"value"`
}
+type Warnings []interface{}
+
type TaskIds []string
// Schema for TaskInstance model with minimal required fields needed for
Runtime.
@@ -1729,24 +1697,70 @@ type TaskInstance struct {
TryNumber int `msgpack:"try_number"`
}
-type TaskInstanceState string
-
const TaskInstanceStateAwaitingInput TaskInstanceState = "awaiting_input"
const TaskInstanceStateDeferred TaskInstanceState = "deferred"
const TaskInstanceStateFailed TaskInstanceState = "failed"
-const TaskInstanceStateQueued TaskInstanceState = "queued"
-const TaskInstanceStateRemoved TaskInstanceState = "removed"
+const TaskInstanceStateSkipped TaskInstanceState = "skipped"
+const TaskInstanceStateUpForReschedule TaskInstanceState = "up_for_reschedule"
const TaskInstanceStateRestarting TaskInstanceState = "restarting"
+const TaskInstanceStateSuccess TaskInstanceState = "success"
const TaskInstanceStateRunning TaskInstanceState = "running"
+const TaskInstanceStateQueued TaskInstanceState = "queued"
const TaskInstanceStateScheduled TaskInstanceState = "scheduled"
-const TaskInstanceStateSkipped TaskInstanceState = "skipped"
-const TaskInstanceStateSuccess TaskInstanceState = "success"
-const TaskInstanceStateUpForReschedule TaskInstanceState = "up_for_reschedule"
const TaskInstanceStateUpForRetry TaskInstanceState = "up_for_retry"
const TaskInstanceStateUpstreamFailed TaskInstanceState = "upstream_failed"
type TaskOutlets []AssetProfile
+const TaskInstanceStateRemoved TaskInstanceState = "removed"
+
+type TaskInstanceState string
+
+type TaskBreadcrumbsResultBreadcrumbsElem map[string]interface{}
+
+type TaskBreadcrumbsResult struct {
+ // Breadcrumbs corresponds to the JSON schema field "breadcrumbs".
+ Breadcrumbs []TaskBreadcrumbsResultBreadcrumbsElem
`msgpack:"breadcrumbs"`
+
+ // Type corresponds to the JSON schema field "type".
+ Type string `msgpack:"type,omitempty"`
+}
+
+// Task callback status information.
+//
+// A Class with information about the success/failure TI callback to be
executed.
+// Currently, only failure
+// callbacks when tasks are externally killed or experience heartbeat timeouts
are
+// run via DagFileProcessorProcess.
+type TaskCallbackRequest struct {
+ // BundleName corresponds to the JSON schema field "bundle_name".
+ BundleName string `msgpack:"bundle_name"`
+
+ // BundleVersion corresponds to the JSON schema field "bundle_version".
+ BundleVersion interface{} `msgpack:"bundle_version"`
+
+ // ContextFromServer corresponds to the JSON schema field
"context_from_server".
+ ContextFromServer *TIRunContext
`msgpack:"context_from_server,omitempty"`
+
+ // Filepath corresponds to the JSON schema field "filepath".
+ Filepath string `msgpack:"filepath"`
+
+ // Msg corresponds to the JSON schema field "msg".
+ Msg interface{} `msgpack:"msg,omitempty"`
+
+ // TaskCallbackType corresponds to the JSON schema field
"task_callback_type".
+ TaskCallbackType interface{} `msgpack:"task_callback_type,omitempty"`
+
+ // TI corresponds to the JSON schema field "ti".
+ TI TaskInstance `msgpack:"ti"`
+
+ // Type corresponds to the JSON schema field "type".
+ Type string `msgpack:"type,omitempty"`
+
+ // VersionData corresponds to the JSON schema field "version_data".
+ VersionData *VersionData `msgpack:"version_data,omitempty"`
+}
+
// Response containing the first reschedule date for a task instance.
type TaskRescheduleStartDate struct {
// StartDate corresponds to the JSON schema field "start_date".
@@ -1756,6 +1770,12 @@ type TaskRescheduleStartDate struct {
Type string `msgpack:"type,omitempty"`
}
+type TaskStateState string
+
+const TaskStateStateFailed TaskStateState = "failed"
+const TaskStateStateSkipped TaskStateState = "skipped"
+const TaskStateStateRemoved TaskStateState = "removed"
+
// Update a task's state.
//
// If a process exits without sending one of these the state will be derived
from
@@ -1776,12 +1796,6 @@ type TaskState struct {
Type string `msgpack:"type,omitempty"`
}
-type TaskStateState string
-
-const TaskStateStateFailed TaskStateState = "failed"
-const TaskStateStateRemoved TaskStateState = "removed"
-const TaskStateStateSkipped TaskStateState = "skipped"
-
// Response to GetTaskStateStore; wraps the generated API response for
supervisor
// to worker comms.
type TaskStateStoreResult struct {
@@ -1789,7 +1803,7 @@ type TaskStateStoreResult struct {
Type string `msgpack:"type,omitempty"`
// Value corresponds to the JSON schema field "value".
- Value JsonValue `msgpack:"value"`
+ Value interface{} `msgpack:"value"`
}
type TaskStates map[string]interface{}
@@ -1831,7 +1845,7 @@ type TriggerDagRun struct {
Type string `msgpack:"type,omitempty"`
}
-type TriggerKwargs map[string]JsonValue
+type VersionData map[string]interface{}
// Update the response content part of an existing Human-in-the-loop response.
type UpdateHITLDetail struct {
@@ -1848,17 +1862,6 @@ type UpdateHITLDetail struct {
Type string `msgpack:"type,omitempty"`
}
-// Variable schema for responses with fields that are needed for Runtime.
-type VariableResponse struct {
- // Key corresponds to the JSON schema field "key".
- Key string `msgpack:"key"`
-
- // Value corresponds to the JSON schema field "value".
- Value interface{} `msgpack:"value"`
-}
-
-type VersionData map[string]interface{}
-
type ValidateInletsAndOutlets struct {
// TIID corresponds to the JSON schema field "ti_id".
TIID string `msgpack:"ti_id"`
@@ -1878,8 +1881,6 @@ type VariableKeysResult struct {
Type string `msgpack:"type,omitempty"`
}
-type Warnings []interface{}
-
type VariableResult struct {
// Key corresponds to the JSON schema field "key".
Key string `msgpack:"key"`
@@ -1888,7 +1889,7 @@ type VariableResult struct {
Type string `msgpack:"type,omitempty"`
// Value corresponds to the JSON schema field "value".
- Value interface{} `msgpack:"value,omitempty"`
+ Value interface{} `msgpack:"value"`
}
// One positional stub-task argument pulled from an upstream task's XCom.
@@ -1923,7 +1924,7 @@ type XComResult struct {
Type string `msgpack:"type,omitempty"`
// Value corresponds to the JSON schema field "value".
- Value JsonValue `msgpack:"value"`
+ Value interface{} `msgpack:"value"`
}
type XComSequenceIndexResult struct {
diff --git a/scripts/ci/prek/dump_supervisor_schemas.py
b/scripts/ci/prek/dump_supervisor_schemas.py
index 9a7de56a8b8..748d7109929 100755
--- a/scripts/ci/prek/dump_supervisor_schemas.py
+++ b/scripts/ci/prek/dump_supervisor_schemas.py
@@ -70,6 +70,18 @@ for key in list(defs):
continue
defs[title] = entry
+# Pydantic renders ``JsonValue`` as an empty schema. That is valid JSON Schema
for "any
+# JSON value", but it leaves a code generator with no type to emit:
go-jsonschema aborts on
+# ``anyOf: [JsonValue, null]`` with "types list is empty". Spell the union out
instead.
+# The title keeps ``--struct-name-from-title`` emitting a named type rather
than inlining
+# the union at every use site.
+for key, val in defs.items():
+ if not val:
+ defs[key] = {
+ "title": key,
+ "type": ["object", "array", "string", "number", "boolean", "null"],
+ }
+
output = json.dumps(snapshot, indent=2)
for old, new in renames.items():
output = output.replace(f'"#/$defs/{old}"', f'"#/$defs/{new}"')
diff --git a/task-sdk/src/airflow/sdk/execution_time/schema/schema.json
b/task-sdk/src/airflow/sdk/execution_time/schema/schema.json
index 85f8b7cfa4e..dc6a8c053ce 100644
--- a/task-sdk/src/airflow/sdk/execution_time/schema/schema.json
+++ b/task-sdk/src/airflow/sdk/execution_time/schema/schema.json
@@ -3150,7 +3150,17 @@
"title": "InactiveAssetsResult",
"type": "object"
},
- "JsonValue": {},
+ "JsonValue": {
+ "title": "JsonValue",
+ "type": [
+ "object",
+ "array",
+ "string",
+ "number",
+ "boolean",
+ "null"
+ ]
+ },
"LazyDeserializedDAG": {
"description": "Lazily build information from the serialized DAG
structure.\n\nAn object that will present \"enough\" of the DAG like interface
to update DAG db models etc, without having\nto deserialize the full DAG and
Task hierarchy.",
"properties": {
diff --git a/ts-sdk/src/generated/supervisor.ts
b/ts-sdk/src/generated/supervisor.ts
index 8eb27a1d815..9b89cbf804c 100644
--- a/ts-sdk/src/generated/supervisor.ts
+++ b/ts-sdk/src/generated/supervisor.ts
@@ -26,13 +26,18 @@ export type Name = string;
export type Id = number;
export type Timestamp = string;
export type Extra = {
- [k: string]: unknown;
+ [k: string]: JsonValue | null;
} | null;
+/**
+ * This interface was referenced by `SupervisorWireSchema`'s JSON-Schema
+ * via the `definition` "JsonValue".
+ */
+export type JsonValue = {} | unknown[] | string | number | boolean | null;
export type Name1 = string;
export type Uri = string;
export type Group = string;
export type Extra1 = {
- [k: string]: unknown;
+ [k: string]: JsonValue | null;
} | null;
export type RunId = string;
export type DagId = string;
@@ -58,7 +63,7 @@ export type Name3 = string;
export type Uri2 = string;
export type Group1 = string;
export type Extra2 = {
- [k: string]: unknown;
+ [k: string]: JsonValue | null;
} | null;
export type Type2 = "AssetResult";
export type Type3 = "AssetStateStoreResult";
@@ -68,7 +73,7 @@ export type State1 = "awaiting_input";
export type Timeout = string | null;
export type NextMethod = string;
export type NextKwargs = {
- [k: string]: unknown;
+ [k: string]: JsonValue | null;
} | null;
export type RenderedMapIndex = string | null;
export type Type5 = "AwaitInputTask";
@@ -166,11 +171,6 @@ export type Conf = {
export type TriggeringUserName = string | null;
export type Name7 = string;
export type Uri4 = string;
-/**
- * This interface was referenced by `SupervisorWireSchema`'s JSON-Schema
- * via the `definition` "JsonValue".
- */
-export type JsonValue = unknown;
export type SourceTaskId1 = string | null;
export type SourceDagId1 = string | null;
export type SourceRunId1 = string | null;
@@ -310,7 +310,7 @@ export type State2 = "deferred";
export type Classpath = string;
export type TriggerKwargs =
| {
- [k: string]: unknown;
+ [k: string]: JsonValue | null;
}
| string
| null;
@@ -318,7 +318,7 @@ export type TriggerTimeout = string | null;
export type Queue1 = string | null;
export type NextMethod2 = string;
export type NextKwargs2 = {
- [k: string]: unknown;
+ [k: string]: JsonValue | null;
} | null;
export type RenderedMapIndex1 = string | null;
export type Type20 = "DeferTask";
@@ -742,7 +742,7 @@ export interface AssetResult {
* via the `definition` "AssetStateStoreResult".
*/
export interface AssetStateStoreResult {
- value: unknown;
+ value: JsonValue | null;
type?: Type3;
}
/**
@@ -1072,7 +1072,7 @@ export interface LiteralArgBinding {
name: Name9;
value_schema?: ArgValueSchema | null;
kind: Kind1;
- value?: unknown;
+ value?: JsonValue | null;
from_default?: FromDefault;
}
/**
@@ -1833,7 +1833,7 @@ export interface TaskState {
* via the `definition` "TaskStateStoreResult".
*/
export interface TaskStateStoreResult {
- value: unknown;
+ value: JsonValue | null;
type?: Type79;
}
/**
@@ -1916,7 +1916,7 @@ export interface XComCountResponse {
*/
export interface XComResult {
key: Key20;
- value: unknown;
+ value: JsonValue | null;
type?: Type87;
}
/**