Show task instance in web UI by custom operator name#31852
Conversation
3047950 to
fbe3f48
Compare
There was a problem hiding this comment.
I think to avoid this we can replace the @property by an sqlalchemy column_property. (Would also allow filtering, and querying against it easily)
There was a problem hiding this comment.
There was a problem hiding this comment.
@pierrejeambrun I believe to do this we would do something like this
operator_name = column_property(
select(
func.IF(custom_operator_name is not None, custom_operator_name, operator)
)
)
But the IF statement is not working with sqlite3. Getting below error -

Is there any other way to accomplish this?
There was a problem hiding this comment.
I think CASE is better supported across databases
There was a problem hiding this comment.
I'll give that a shot.
There was a problem hiding this comment.
@uranusjr @pierrejeambrun using column_property raises below issue
AttributeError: Neither 'Label' object nor 'Comparator' object has an attribute 'nullable' when looking for a solution ran into this thread - marshmallow-code/marshmallow-sqlalchemy#97
As mentioned in the thread it's fixed in 0.28.0 But we cannot upgrade to 0.28.0 because of the below issue -
flask-appbuilder 4.3.1 requires marshmallow-sqlalchemy<0.27.0,>=0.22.0,
flask-appbuilder is pinned to 4.3.1 here -
Line 292 in fe7a1aa
Unfortunately even in the latest version of flask-appbuilder 4.3.2 we still have upperbound on marshmallow-sqlalchemy>=0.22.0, <0.27.0
https://github.com/dpgaspar/Flask-AppBuilder/blob/9090d096f697cf03dd80ebc656a6b0e79a05adb3/setup.py#LL61
There was a problem hiding this comment.
The thread mentions adding an explicit field. Maybe this can be worked around by adding an operator_name field in the Marshmallow model?
There was a problem hiding this comment.
@uranusjr AFAIK, I don't think we are generating Marshmallow models directly, it's done flask_appbuilder/api/convert.py. Is there any other way that I'm not aware of?
149f6d9 to
1c3efd8
Compare
|
@pierrejeambrun Would it be OK if we go with the current code and investigate |
we should use
operator_namewhen displaying the operator name in UI for taskinstance object.Related: #28466