yampelo commented on issue #5263: [AIRFLOW-4490] dag_run.conf should be an 
empty dictionary by default instead of None
URL: https://github.com/apache/airflow/pull/5263#issuecomment-491142449
 
 
   Is there ever a case where the DagRun is not committed to that database 
immediately?  Defining the default value in the `Column` constructor (like this 
`Column(PickleType, default={})`) will only use the default value after an 
`INSERT` statement. That means that:
   ```python
   dag_run = DagRun(....) # initialized without a conf 
   dag_run.conf  == None # None at this point
   
   session.add(dag_run)
   session.commit() # Insert places default value
   
   dag_run_in_db = Session.query(DagRun).first()
   dag_run_in_db.conf == {} # conf is now the default value
   ```

----------------------------------------------------------------
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

Reply via email to