uranusjr commented on code in PR #71757:
URL: https://github.com/apache/airflow/pull/71757#discussion_r4357231946
##########
scripts/ci/prek/lang_sdk_compat_matrix.py:
##########
@@ -88,54 +100,150 @@ class Capability(NamedTuple):
Capability("asset-state-store", "MAY", "runtime", False),
Capability("asset-event-emit", "MAY", "runtime", False),
Capability("asset-event-read", "MAY", "runtime", False),
- Capability(NATIVE_DAG_GATE, "SHOULD", "native", False),
- Capability("task-args", "MUST", "native", True),
- Capability("dag-params", "MUST", "native", True),
- Capability("taskflow-dependencies", "MUST", "native", True),
- Capability("branching", "SHOULD", "native", True),
- Capability("dag-test", "SHOULD", "native", True),
- Capability("task-group", "MAY", "native", True),
- Capability("dynamic-task-mapping", "MAY", "native", True),
- Capability("asset-inlets-outlets", "MAY", "native", True),
- Capability("asset-scheduling", "MAY", "native", True),
- Capability("object-store", "MAY", "native", True),
+ Capability("object-store", "MAY", "runtime", False),
+ Capability("listeners", "MAY", "runtime", False),
+ Capability(DAG_DEFINITION_GATE, "SHOULD", "dag-definition", False),
+ Capability("dag-args", "MUST", "dag-definition", True),
+ Capability("task-args", "MUST", "dag-definition", True),
+ Capability("dag-params", "MUST", "dag-definition", True),
+ Capability("explicit-dependencies", "MUST", "dag-definition", True),
+ Capability("edge-labels", "MAY", "dag-definition", True),
+ Capability("taskflow-dependencies", "MUST", "dag-definition", True),
+ Capability("task-group", "MAY", "dag-definition", True),
+ Capability("task-loops", "MAY", "dag-definition", True),
+ Capability("if-else-branching", "SHOULD", "dag-definition", True),
+ Capability("switch-case-branching", "SHOULD", "dag-definition", True),
+ Capability("trigger-dag-run", "MAY", "dag-definition", True),
+ Capability("provider-operators", "MAY", "dag-definition", True),
+ Capability("dynamic-dag-generation", "MAY", "dag-definition", True),
+ Capability("human-in-the-loop", "MAY", "dag-definition", True),
+ Capability("dag-test", "SHOULD", "dag-definition", True),
+ Capability("asset-definition", "MAY", "dag-definition", True),
+ Capability("asset-scheduling", "MAY", "dag-definition", True),
+ Capability("mixed-lang-stub-target", "MUST", "stub-task-handler", False),
+ Capability("taskflow-binding", "MUST", "stub-task-handler", False),
+ Capability("mapped-tasks", "MAY", "shared", True),
+ Capability("asset-inlets-outlets", "MAY", "shared", True),
+ Capability("callbacks", "MAY", "shared", True),
]
CAPABILITY_NAMES = {cap.name for cap in CAPABILITY_DIMENSIONS}
-
-GROUP_LABELS = {"runtime": "Runtime capabilities", "native": "Native-Dag
authoring"}
-STATES_GROUP_LABEL = "TaskInstance states"
+SHARED_CAPABILITY_NAMES = {cap.name for cap in CAPABILITY_DIMENSIONS if
cap.group == "shared"}
LEGEND = (
f"Marks: {SUPPORTED_MARK} supported · {UNSUPPORTED_MARK} not supported · "
- f"{NA_MARK} not applicable. A tier marked † applies only when
`{NATIVE_DAG_GATE}` is supported."
+ f"{NA_MARK} not applicable. A tier marked † applies only when
`{DAG_DEFINITION_GATE}` is supported."
)
+class MatrixRow(NamedTuple):
+ kind: RowKind
+ name: str
+ tier: Tier
+ gated: bool
+ mode: Mode | None # the authoring mode whose entry a shared capability
shows
+
+ @property
+ def entry_key(self) -> EntryKey:
+ return self.kind, self.name, self.mode
+
+
+GATE_KEY: Final[EntryKey] = ("capability", DAG_DEFINITION_GATE, None)
+
+
+class MatrixGroup(NamedTuple):
+ label: str
+ rows: list[MatrixRow]
+
+
+class MatrixPart(NamedTuple):
+ title: str
+ groups: list[MatrixGroup]
+
+
+class MatrixParts(NamedTuple):
+ common: MatrixPart
+ dag_definition: MatrixPart
+ stub_task_handler: MatrixPart
+
+
+def _build_capability_rows(groups: tuple[Group, ...], mode: Mode | None) ->
list[MatrixRow]:
+ return [
+ MatrixRow(
+ "capability",
+ cap.name,
+ cap.tier,
+ cap.gated and mode != STUB_TASK_HANDLER_MODE,
+ # Only a shared capability has one entry per authoring mode to
pick between.
Review Comment:
```suggestion
```
Really don’t think this is needed
--
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]