dilnazanlid commented on code in PR #72369:
URL: https://github.com/apache/airflow/pull/72369#discussion_r3955710582


##########
task-sdk/src/airflow/sdk/importers/base.py:
##########
@@ -0,0 +1,316 @@
+# 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.
+"""Abstract base class for DAG importers."""
+
+from __future__ import annotations
+
+import contextlib
+import logging
+import threading
+from abc import ABC, abstractmethod
+from collections.abc import Iterator
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import TYPE_CHECKING, Any
+
+from airflow.sdk._shared.module_loading.file_discovery import 
find_path_from_directory
+
+if TYPE_CHECKING:
+    from airflow.sdk import DAG

Review Comment:
   Why though? 
   
   1. In DagImportResult we need to return the list of DAG objects. 
   2. The importers live in `task-sdk`. `LazyDeserializedDAG` is defined in 
`airflow-core`. Importing it here would create a circular dependency between 
Task SDK and Core, violating SDK's isolation.
   3. Importers are responsible for evaluating definition files into in-memory 
`airflow.sdk.DAG` instances. IIUC the serialization happens downstream in the 
DagBag after validation.
   
   Let me know if I am missing something 



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