amoghrajesh commented on code in PR #57853:
URL: https://github.com/apache/airflow/pull/57853#discussion_r2497860903
##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -1707,6 +1707,25 @@ def set_task_dag_references(task: SerializedOperator |
MappedOperator, dag: Seri
# Bypass set_upstream etc here - it does more than we want
dag.task_dict[task_id].upstream_task_ids.add(task.task_id)
+ @classmethod
+ @lru_cache(maxsize=1) # Only one type: "operator"
+ def get_operator_const_fields(cls) -> set[str]:
+ schema_loader = cls._json_schema
+
+ if schema_loader is None:
+ return set()
+
+ schema_data = schema_loader.schema
+ operator_def = schema_data.get("definitions", {}).get("operator", {})
+ properties = operator_def.get("properties", {})
+
+ const_fields = set()
+ for field_name, field_def in properties.items():
+ if isinstance(field_def, dict) and field_def.get("const") is True:
+ const_fields.add(field_name)
+
+ return const_fields
Review Comment:
Just checked the schema.json and played around with the conditional, its
either None or True, so not 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]