potiuk commented on a change in pull request #5413: [AIRFLOW-4690] Make
tests/api Pylint compatible
URL: https://github.com/apache/airflow/pull/5413#discussion_r294297779
##########
File path: airflow/models/dagrun.py
##########
@@ -65,6 +65,17 @@ class DagRun(Base, LoggingMixin):
UniqueConstraint('dag_id', 'run_id'),
)
+ def __init__(self, dag_id=None, run_id=None, execution_date=None,
start_date=None, external_trigger=None,
+ conf=None, state=None, **kwargs):
+ self.dag_id = dag_id
+ self.run_id = run_id
+ self.execution_date = execution_date
+ self.start_date = start_date
+ self.external_trigger = external_trigger
+ self.conf = conf
+ self.state = state
+ super().__init__(**kwargs)
Review comment:
Yeah. I am also for explicit naming of _init_ parameters (explicit is better
than implicit). It makes it so much easier to understand what is going on
especially when we add more type annotations as we go. It's again very similar
story of making the code more readable and easy to understand by people who
just want to contribute a fix or two. As a general rule - I tend to write a bit
more code than bare minimum if I can say something explicitly - at the end the
code will be read many times more than written and optimisation for reading
"pleasure" ;) is important.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services