You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/02/17 12:11:58 UTC
[GitHub] [airflow] ashb commented on a change in pull request #21641: Implement mapped value unpacking
ashb commented on a change in pull request #21641:
URL: https://github.com/apache/airflow/pull/21641#discussion_r808982659
##########
File path: airflow/models/mappedoperator.py
##########
@@ -55,38 +58,65 @@
TaskStateChangeCallback,
)
from airflow.models.pool import Pool
-from airflow.models.xcom_arg import XComArg
from airflow.serialization.enums import DagAttributeTypes
from airflow.ti_deps.deps.base_ti_dep import BaseTIDep
from airflow.ti_deps.deps.mapped_task_expanded import MappedTaskIsExpanded
+from airflow.typing_compat import Literal
+from airflow.utils.context import Context
from airflow.utils.operator_resources import Resources
-from airflow.utils.session import NEW_SESSION
from airflow.utils.state import State, TaskInstanceState
from airflow.utils.task_group import TaskGroup
from airflow.utils.trigger_rule import TriggerRule
+from airflow.utils.types import NOTSET
if TYPE_CHECKING:
+ import jinja2 # Slow import.
+
from airflow.models.baseoperator import BaseOperator, BaseOperatorLink
from airflow.models.dag import DAG
from airflow.models.taskinstance import TaskInstance
+ from airflow.models.xcom_arg import XComArg
+
+ # BaseOperator.map() can be called on an XComArg, sequence, or dict (not any
+ # mapping since we need the value to be ordered).
+ MapArgument = Union[XComArg, Sequence, dict]
+
+ValidationSource = Union[Literal["map"], Literal["partial"]]
Review comment:
I think you can do this
```suggestion
ValidationSource = Literal["map", "partial"]
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org