uranusjr commented on code in PR #54383:
URL: https://github.com/apache/airflow/pull/54383#discussion_r2297346206
##########
airflow-core/src/airflow/__init__.py:
##########
@@ -80,21 +80,20 @@
# Things to lazy import in form {local_name: ('target_module', 'target_name',
'deprecated')}
__lazy_imports: dict[str, tuple[str, str, bool]] = {
- "DAG": (".models.dag", "DAG", False),
- "Asset": (".assets", "Asset", False),
+ "DAG": (".sdk", "DAG", False),
+ "Asset": (".sdk", "Asset", False),
"XComArg": (".models.xcom_arg", "XComArg", False),
"version": (".version", "", False),
# Deprecated lazy imports
"AirflowException": (".exceptions", "AirflowException", True),
- "Dataset": (".sdk.definitions.asset", "Asset", True),
+ "Dataset": (".sdk", "Asset", True),
}
if TYPE_CHECKING:
# These objects are imported by PEP-562, however, static analyzers and
IDE's
# have no idea about typing of these objects.
# Add it under TYPE_CHECKING block should help with it.
- from airflow.models.dag import DAG
from airflow.models.xcom_arg import XComArg
- from airflow.sdk.definitions.asset import Asset, Dataset
+ from airflow.sdk import DAG, Asset, Asset as Dataset
Review Comment:
Yes, the Dataset name is for compatibility.
--
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]