patchandpray commented on issue #12489:
URL: https://github.com/apache/airflow/issues/12489#issuecomment-737027781


   Hi, I think I need some help.
   
   I have been able to deduce that the issue arises upon form autogeneration 
for a taskinstance by flask-appbuilder. When editing a taskinstance. A 
taskinstance appears to have a one on one relationship with a DagRun and when 
generating the edit form flask_appbuilder uses 
`QuerySelectMultipleField.iter_choices()` which gets called with: `<DagRun 
example_bash_operator @ 2020-11-29 00:00:00+00:00: 
scheduled__2020-11-29T00:00:00+00:00, externally triggered: False>`. Since this 
is a non-iterable object the exception is raised.
   
   When using `QuerySelectField.iter_choices()` with this object the form does 
generate but I am stuck finding a way to force this behavior from airflow code. 
An option might be to not autogenerate a form and specify a form for 
taskinstance edit so we can explicitly define which fields to use but I am 
unsure if this is the correct way to implement a fix for this.
   
   Also, how is determined which fields are generated for this form?
   
   Furthermore when forcing the generation from flask_appbuilder and generating 
a form:
   
![image](https://user-images.githubusercontent.com/38275186/100837701-637cbc80-3471-11eb-8d2e-35c9db92d99f.png)
   
   when trying to save a modification for a taskinstance I am presented with 
this error. I want to create a new bug report for this but it might be related 
to this bug.
   
![image](https://user-images.githubusercontent.com/38275186/100836913-793db200-3470-11eb-8116-5ce2e4d45dba.png)
   


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to