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/09/23 09:12:26 UTC

[GitHub] [airflow] JoranDox commented on issue #19519: datetime in parameters cause "TypeError: Object of type set is not JSON serializable"

JoranDox commented on issue #19519:
URL: https://github.com/apache/airflow/issues/19519#issuecomment-1255973254

   Looks like it's back? Or at least something very similar (in this case a timedelta not being json serializable). Should I create a new ticket for this or just add my log here?
   
   <details>
   Ooops!
   Something bad has happened.
   
   Airflow is used by many users, and it is very likely that others had similar problems and you can easily find
   a solution to your problem.
   
   Consider following these steps:
   
     * gather the relevant information (detailed logs with errors, reproduction steps, details of your deployment)
   
     * find similar issues using:
        * [GitHub Discussions](https://github.com/apache/airflow/discussions)
        * [GitHub Issues](https://github.com/apache/airflow/issues)
        * [Stack Overflow](https://stackoverflow.com/questions/tagged/airflow)
        * the usual search engine you use on a daily basis
   
     * if you run Airflow on a Managed Service, consider opening an issue using the service support channels
   
     * if you tried and have difficulty with diagnosing and fixing the problem yourself, consider creating a [bug report](https://github.com/apache/airflow/issues/new/choose).
       Make sure however, to include all relevant details and results of your investigation so far.
   
   Python version: 3.9.14
   Airflow version: 2.3.4+astro.2
   Node: nebular-instrument-9608-webserver-6955c95644-t2d9z
   -------------------------------------------------------------------------------
   Traceback (most recent call last):
     File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app
       response = self.full_dispatch_request()
     File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request
       rv = self.handle_user_exception(e)
     File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1820, in full_dispatch_request
       rv = self.dispatch_request()
     File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1796, in dispatch_request
       return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
     File "/usr/local/lib/python3.9/site-packages/airflow/www/auth.py", line 46, in decorated
       return func(*args, **kwargs)
     File "/usr/local/lib/python3.9/site-packages/airflow/www/decorators.py", line 117, in view_func
       return f(*args, **kwargs)
     File "/usr/local/lib/python3.9/site-packages/airflow/www/decorators.py", line 80, in wrapper
       return f(*args, **kwargs)
     File "/usr/local/lib/python3.9/site-packages/airflow/utils/session.py", line 71, in wrapper
       return func(*args, session=session, **kwargs)
     File "/usr/local/lib/python3.9/site-packages/airflow/www/views.py", line 2984, in graph
       return self.render_template(
     File "/usr/local/lib/python3.9/site-packages/airflow/www/views.py", line 709, in render_template
       return super().render_template(
     File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/baseviews.py", line 322, in render_template
       return render_template(
     File "/usr/local/lib/python3.9/site-packages/flask/templating.py", line 147, in render_template
       return _render(app, template, context)
     File "/usr/local/lib/python3.9/site-packages/flask/templating.py", line 130, in _render
       rv = template.render(context)
     File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
       self.environment.handle_exception()
     File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
       raise rewrite_traceback_stack(source=source)
     File "/usr/local/lib/python3.9/site-packages/airflow/www/templates/airflow/graph.html", line 21, in top-level template code
       {% from 'appbuilder/loading_dots.html' import loading_dots %}
     File "/usr/local/lib/python3.9/site-packages/airflow/www/templates/airflow/dag.html", line 36, in top-level template code
       {% set execution_date_arg = request.args.get('execution_date') %}
     File "/usr/local/lib/python3.9/site-packages/astronomer/airflow/version_check/templates/astro-baselayout.html", line 1, in top-level template code
       {% extends airflow_base_template %}
     File "/usr/local/lib/python3.9/site-packages/airflow/www/templates/airflow/main.html", line 21, in top-level template code
       {% from 'airflow/_messages.html' import show_message %}
     File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 2, in top-level template code
       {% import 'appbuilder/baselib.html' as baselib %}
     File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 50, in top-level template code
       {% block tail %}
     File "/usr/local/lib/python3.9/site-packages/airflow/www/templates/airflow/graph.html", line 137, in block 'tail'
       let taskInstances = {{ task_instances|tojson }};
     File "/usr/local/lib/python3.9/site-packages/jinja2/filters.py", line 1688, in do_tojson
       return htmlsafe_json_dumps(value, dumps=dumps, **kwargs)
     File "/usr/local/lib/python3.9/site-packages/jinja2/utils.py", line 658, in htmlsafe_json_dumps
       dumps(obj, **kwargs)
     File "/usr/local/lib/python3.9/site-packages/flask/json/provider.py", line 230, in dumps
       return json.dumps(obj, **kwargs)
     File "/usr/local/lib/python3.9/json/__init__.py", line 234, in dumps
       return cls(
     File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode
       chunks = self.iterencode(o, _one_shot=True)
     File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode
       return _iterencode(o, 0)
     File "/usr/local/lib/python3.9/site-packages/airflow/utils/json.py", line 108, in _default
       raise TypeError(f"Object of type '{obj.__class__.__name__}' is not JSON serializable")
   TypeError: Object of type 'timedelta' is not JSON serializable
   </details>
   


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