jedcunningham commented on code in PR #38616:
URL: https://github.com/apache/airflow/pull/38616#discussion_r1544818510
##########
airflow/api_connexion/schemas/dag_schema.py:
##########
@@ -96,21 +96,21 @@ class DAGDetailSchema(DAGSchema):
"""DAG details."""
owners = fields.Method("get_owners", dump_only=True)
- timezone = TimezoneField()
- catchup = fields.Boolean()
- orientation = fields.String()
+ timezone = TimezoneField(dump_only=True)
+ catchup = fields.Boolean(dump_only=True)
+ orientation = fields.String(dump_only=True)
concurrency = fields.Method("get_concurrency") # TODO: Remove in Airflow
3.0
- max_active_tasks = fields.Integer()
+ max_active_tasks = fields.Integer(dump_only=True)
dataset_expression = fields.Dict(allow_none=True)
- start_date = fields.DateTime()
+ start_date = fields.DateTime(dump_only=True)
dag_run_timeout = fields.Nested(TimeDeltaSchema,
attribute="dagrun_timeout")
Review Comment:
Shouldn't this be dump_only too?
##########
airflow/api_connexion/schemas/task_instance_schema.py:
##########
@@ -44,32 +44,32 @@ class Meta:
model = TaskInstance
- task_id = auto_field()
- dag_id = auto_field()
- run_id = auto_field(data_key="dag_run_id")
- map_index = auto_field()
- execution_date = auto_field()
- start_date = auto_field()
- end_date = auto_field()
- duration = auto_field()
- state = TaskInstanceStateField()
- _try_number = auto_field(data_key="try_number")
- max_tries = auto_field()
+ task_id = auto_field(dump_only=True)
+ dag_id = auto_field(dump_only=True)
+ run_id = auto_field(data_key="dag_run_id", dump_only=True)
+ map_index = auto_field(dump_only=True)
+ execution_date = auto_field(dump_only=True)
+ start_date = auto_field(dump_only=True)
+ end_date = auto_field(dump_only=True)
+ duration = auto_field(dump_only=True)
+ state = TaskInstanceStateField(dump_only=True)
+ _try_number = auto_field(data_key="try_number", dump_only=True)
+ max_tries = auto_field(dump_only=True)
task_display_name = fields.String(attribute="task_display_name",
dump_only=True)
- hostname = auto_field()
- unixname = auto_field()
- pool = auto_field()
- pool_slots = auto_field()
- queue = auto_field()
- priority_weight = auto_field()
- operator = auto_field()
- queued_dttm = auto_field(data_key="queued_when")
- pid = auto_field()
- executor_config = auto_field()
- note = auto_field()
- sla_miss = fields.Nested(SlaMissSchema, dump_default=None)
- rendered_map_index = auto_field()
- rendered_fields = JsonObjectField(dump_default={})
+ hostname = auto_field(dump_only=True)
+ unixname = auto_field(dump_only=True)
+ pool = auto_field(dump_only=True)
+ pool_slots = auto_field(dump_only=True)
+ queue = auto_field(dump_only=True)
+ priority_weight = auto_field(dump_only=True)
+ operator = auto_field(dump_only=True)
+ queued_dttm = auto_field(data_key="queued_when", dump_only=True)
+ pid = auto_field(dump_only=True)
+ executor_config = auto_field(dump_only=True)
+ note = auto_field(dump_only=True)
+ sla_miss = fields.Nested(SlaMissSchema, dump_default=None, dump_only=True)
+ rendered_map_index = auto_field(dump_only=True)
+ rendered_fields = JsonObjectField(dump_default={}, dump_only=True)
trigger = fields.Nested(TriggerSchema)
triggerer_job = fields.Nested(JobSchema)
Review Comment:
Same with these, also dump_only?
--
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]