You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello. Changed airflow version (2.2.1->2.4.2). However, the following typeerror occurred.
For reference, the same problem was confirmed in airflow 2.3.4.
I tried changing the airflow response type, but the problem was not resolved. Is there a case where there is a problem with werzeug while changing the version?
@app_builder_expose("/api", methods=["GET", "POST"]) # for Flask AppBuilder@http_token_secure# On each request@jwt_token_secure# On each requestdefapi(self):
final_response= {
"status": status,
"http_response_code": http_response_code,
"call_time": call_time,
}
final_response["output"] ="test"logging.info("type(final_response): {}".format(type(final_response)))
logging.info("final_response: {}".format(final_response))
returnmake_response(jsonify({"data": final_response}), 200)
2022-11-30T01:25:37.644+0000] {rest_api_plugin.py:1355} INFO - type(final_response): <class 'dict'>
[2022-11-30T01:25:37.644+0000] {rest_api_plugin.py:1356} INFO - final_response: {'status': 'OK', 'http_response_code': 200, 'call_time': datetime.datetime(2022, 11, 29, 21, 40, 59, 769334), 'arguments': ImmutableMultiDict([('api', 'deploy_dag')]), 'post_arguments': ImmutableMultiDict([('force', 'on'), ('deployId', '6386b10d0cdd6e28b99bb4ff'), ('callbackURL', 'https://mlu-beta.linecorp.com/portal/callback/pipeline/deploy/log'), ('callbackToken', '36cc2023831944bba7635fd50afcabd7'), ('username', 'LP10824'), ('airflowId', '637dcd7a77ce44eafb9d0371')]), 'response_time': datetime.datetime(2022, 11, 30, 1, 25, 37, 644330), 'output': '|LP10824|DAG File(filename: dag1.yaml) has been uploaded|637dcd7a77ce44eafb9d0371'}
[2022-11-30T01:25:37.645+0000] {app.py:1741} ERROR - Exception on /admin/rest_api/api [POST]
Traceback (most recent call last):
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
return self.finalize_request(rv)
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 1842, in finalize_request
response = self.make_response(rv)
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 2162, in make_response
raise TypeError(
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 2158, in make_response
rv = self.response_class.force_type(
File "/home/airflow/.local/lib/python3.9/site-packages/werkzeug/wrappers/response.py", line 268, in force_type
response = Response(*run_wsgi_app(response, environ))
File "/home/airflow/.local/lib/python3.9/site-packages/werkzeug/test.py", line 1242, in run_wsgi_app
app_rv = app(environ, start_response)
TypeError: wrapper() takes 1 positional argument but 2 were given
The view function did not return a valid response. The return type must be a string, dict, list, tuple with headers or status, Response instance, or WSGI callable, but it was a function.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
hello. Changed airflow version (2.2.1->2.4.2). However, the following typeerror occurred.
For reference, the same problem was confirmed in airflow 2.3.4.
I tried changing the airflow response type, but the problem was not resolved. Is there a case where there is a problem with werzeug while changing the version?
Beta Was this translation helpful? Give feedback.
All reactions