uranusjr commented on code in PR #74084:
URL: https://github.com/apache/airflow/pull/74084#discussion_r4203528883
##########
task-sdk/src/airflow/sdk/importers/yaml_importer/schema.json:
##########
@@ -0,0 +1,306 @@
+{
+ "$defs": {
+ "CodeTask": {
+ "additionalProperties": true,
+ "description": "A task running custom code.\n\nThis should have ``run``
holding function arguments, and optionally\n``queue`` to route it.",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "type": "string"
+ },
+ "needs": {
+ "items": {
+ "type": "string"
+ },
+ "title": "Needs",
+ "type": "array"
+ },
+ "extends": {
+ "items": {
+ "type": "string"
+ },
+ "title": "Extends",
+ "type": "array"
+ },
+ "with": {
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/$defs/XComRef"
+ },
+ {
+ "$ref": "#/$defs/TemplateRef"
+ },
+ {
+ "$ref": "#/$defs/ConstRef"
+ },
+ {
+ "$ref": "#/$defs/_Literal"
+ }
+ ]
+ },
+ "title": "With",
+ "type": "object"
+ },
+ "run": {
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/$defs/XComRef"
+ },
+ {
+ "$ref": "#/$defs/TemplateRef"
+ },
+ {
+ "$ref": "#/$defs/ConstRef"
+ },
+ {
+ "$ref": "#/$defs/_Literal"
+ }
+ ]
+ },
+ "title": "Run",
+ "type": "object"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "title": "CodeTask",
+ "type": "object"
+ },
+ "ConstRef": {
+ "additionalProperties": false,
+ "description": "Force a literal; the value is taken verbatim.",
+ "properties": {
+ "$const": {
+ "title": "$Const"
+ }
+ },
+ "required": [
+ "$const"
+ ],
+ "title": "ConstRef",
+ "type": "object"
+ },
+ "OperatorTask": {
+ "additionalProperties": true,
+ "description": "A ready-made operator.\n\nThis should have ``uses``
(import path) + ``with``.",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "type": "string"
+ },
+ "needs": {
+ "items": {
+ "type": "string"
+ },
+ "title": "Needs",
+ "type": "array"
+ },
+ "extends": {
+ "items": {
+ "type": "string"
+ },
+ "title": "Extends",
+ "type": "array"
+ },
+ "with": {
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/$defs/XComRef"
+ },
+ {
+ "$ref": "#/$defs/TemplateRef"
+ },
+ {
+ "$ref": "#/$defs/ConstRef"
+ },
+ {
+ "$ref": "#/$defs/_Literal"
+ }
+ ]
+ },
+ "title": "With",
+ "type": "object"
+ },
+ "uses": {
+ "title": "Uses",
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "uses"
+ ],
+ "title": "OperatorTask",
+ "type": "object"
+ },
+ "TaskTemplate": {
+ "additionalProperties": true,
+ "description": "A reusable, partial task fragment merged into any task
that ``extends`` it.\n\nThis holds arbitrary keys as-is. All validation is done
on the merged task.",
+ "properties": {},
+ "title": "TaskTemplate",
+ "type": "object"
+ },
+ "TemplateRef": {
+ "additionalProperties": false,
+ "description": "A Jinja template.",
+ "properties": {
+ "$t": {
+ "title": "$T",
+ "type": "string"
+ }
+ },
+ "required": [
+ "$t"
+ ],
+ "title": "TemplateRef",
+ "type": "object"
+ },
+ "TimetableSchedule": {
+ "additionalProperties": false,
+ "description": "A constructed timetable.",
+ "properties": {
+ "uses": {
+ "title": "Uses",
+ "type": "string"
+ },
+ "with": {
Review Comment:
Changed to `Any`. This would make the argument validation lax, but that’s
already the case in Python (you _can_ pass in an XComArg, it just won’t
resolve), so I think it’s fine.
--
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]