You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/11/14 14:14:58 UTC
[GitHub] [airflow] tstriker commented on pull request #25753: Fix Flask deprecation warning
tstriker commented on PR #25753:
URL: https://github.com/apache/airflow/pull/25753#issuecomment-1313777602
@jedcunningham, @potiuk just a quick heads up: this line (https://github.com/astronomer/airflow/blob/52593b061c32d071243c46fe45784a78b57a04b6/airflow/www/app.py#L116)
```python
flask_app.json_provider_class = AirflowJsonProvider
```
does **nothing**, as the `.json` has already been initiated with the default class upon instantiation of `flask_app`
an in-place solution is rather trivial: instead of replacing the class, you can replace the instance as per flask documentation
```python
flask_app.json = AirflowJsonEncoder(flask_app)
```
for reference, the code example in the original flask pull request offers both versions, subclassed and assigned after the instantiation:
https://github.com/pallets/flask/pull/4692#issue-1303581666
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org