Lee-W commented on code in PR #50773:
URL: https://github.com/apache/airflow/pull/50773#discussion_r2122806786
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -791,6 +796,22 @@ def _prepare(ti: RuntimeTaskInstance, log: Logger,
context: Context) -> ToSuperv
return None
+def _validate_task_inlets_and_outlets(*, ti: RuntimeTaskInstance, log: Logger)
-> None:
+ if not ti.task.inlets and not ti.task.outlets:
+ return
+
+ SUPERVISOR_COMMS.send_request(msg=ValidateInletsAndOutlets(ti_id=ti.id),
log=log)
+ inactive_assets_resp = SUPERVISOR_COMMS.get_message()
+ if TYPE_CHECKING:
+ assert isinstance(inactive_assets_resp, InactiveAssetsResult)
+ if inactive_assets := inactive_assets_resp.inactive_assets:
+ raise AirflowInactiveAssetInInletOrOutletException(
+ inactive_asset_keys=[
+ AssetUniqueKey.from_profile(asset_profile) for asset_profile
in inactive_assets
+ ]
+ )
Review Comment:
don't really know why 🤔 but this is how
https://github.com/apache/airflow/pull/50141/files#diff-f660147b2482fe9eb7c256a6e9b5c0d8c0623fc31beaf5048e476e9bd1b7823bL1735
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -791,6 +796,22 @@ def _prepare(ti: RuntimeTaskInstance, log: Logger,
context: Context) -> ToSuperv
return None
+def _validate_task_inlets_and_outlets(*, ti: RuntimeTaskInstance, log: Logger)
-> None:
+ if not ti.task.inlets and not ti.task.outlets:
+ return
+
+ SUPERVISOR_COMMS.send_request(msg=ValidateInletsAndOutlets(ti_id=ti.id),
log=log)
+ inactive_assets_resp = SUPERVISOR_COMMS.get_message()
+ if TYPE_CHECKING:
+ assert isinstance(inactive_assets_resp, InactiveAssetsResult)
+ if inactive_assets := inactive_assets_resp.inactive_assets:
+ raise AirflowInactiveAssetInInletOrOutletException(
+ inactive_asset_keys=[
+ AssetUniqueKey.from_profile(asset_profile) for asset_profile
in inactive_assets
+ ]
+ )
Review Comment:
Yes
--
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]