Calder-Ty commented on code in PR #34568:
URL: https://github.com/apache/airflow/pull/34568#discussion_r1335852434
##########
airflow/api_connexion/schemas/task_instance_schema.py:
##########
@@ -180,7 +180,7 @@ def validate_form(self, data, **kwargs):
class SetSingleTaskInstanceStateFormSchema(Schema):
"""Schema for handling the request of updating state of a single task
instance."""
- dry_run = fields.Boolean(dump_default=True)
+ dry_run = fields.Boolean(dump_default=True, load_default=True)
Review Comment:
Respectfully, I think this is a better fix than using `.get('dry_run',
False)`. The Schema is a more natural place to define defaults for the request
input. It also ensures that dry_run will _always_ have a value. The alternative
does not help if in the future someone comes and tries to do a raw indexing
access again. Anytime the `dry_run` parameter is accessed we (or another
contributor who is unfamiliar with this conversation) would have to know that
`dry_run` could possibly not exist as a key and the the default ought to be
`False` (or `True`, depending on how that conversation is decided).
--
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]