kaxil commented on code in PR #74084:
URL: https://github.com/apache/airflow/pull/74084#discussion_r4183857516


##########
task-sdk/src/airflow/sdk/importers/yaml_importer/__init__.py:
##########
@@ -0,0 +1,38 @@
+# 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.
+"""
+Native YAML/JSON DAG format for Airflow (`$schema` version 2026-10-30).
+
+Public API:

Review Comment:
   This calls itself the public API, but the importer base it belongs to is 
marked `|experimental|` (`AbstractDagImporter`, base.py:233). The format is 
still being settled on the dev list and several keys raise "not yet 
implemented", so should this package carry the same marker, keeping the 
2026-10-30 shape free to change?



##########
task-sdk/src/airflow/sdk/importers/yaml_importer/migrator.py:
##########
@@ -0,0 +1,132 @@
+# 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.
+"""
+`$schema` version resolution and forward migration to the head shape.
+
+A document pinned to an older `$schema` version is migrated up to the current 
head shape
+*before* validation, by walking the Cadwyn version bundle and applying each 
`VersionChange`'s
+forward request converters 
(`@convert_request_to_next_version_for(DagDocument)`), oldest to
+newest. This mirrors the exec-API / supervisor-schema `SchemaVersionMigrator`, 
trimmed to the
+one direction a document format needs (author's version -> head), with the 
bundle and its
+version list encapsulated in the migrator rather than exposed as module-level 
helpers.
+
+With a single published version there is nothing to migrate; the machinery is 
here so a future
+version bump only has to add a `VersionChange` carrying a converter — no 
parser changes.
+"""
+
+from __future__ import annotations
+
+import copy
+import functools
+import re
+import warnings
+from typing import TYPE_CHECKING, Any
+
+import attrs
+
+from airflow.sdk.importers.yaml_importer.models import DagDocument
+from airflow.sdk.importers.yaml_importer.versions import get_bundle
+
+if TYPE_CHECKING:
+    from cadwyn import VersionBundle
+
+_SCHEMA_URL = "https://airflow.apache.org/schemas/dag/{date}.json";

Review Comment:
   Nothing publishes `https://airflow.apache.org/schemas/dag/2026-10-30.json` 
yet: `publish-schemas-to-s3` only takes the Execution API and supervisor 
schemas. There is also no counterpart to `check-supervisor-schemas-versions`, 
so a later models.py change would rewrite the 2026-10-30 schema in place. Is 
that planned as a follow-up? If so, it's worth a line in the description, since 
editors that fetch `$schema` will get a 404 until then.



-- 
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]

Reply via email to