{"action":"opened","issue":{"url":"https://api.github.com/repos/airbnb/airflow/issues/416","labels_url":"https://api.github.com/repos/airbnb/airflow/issues/416/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/airflow/issues/416/comments","events_url":"https://api.github.com/repos/airbnb/airflow/issues/416/events","html_url":"https://github.com/airbnb/airflow/issues/416","id":107035986,"number":416,"title":"Python3 pandas json encoding problem","user":{"login":"LilithWittmann","id":891030,"avatar_url":"https://avatars.githubusercontent.com/u/891030?v=3","gravatar_id":"","url":"https://api.github.com/users/LilithWittmann","html_url":"https://github.com/LilithWittmann","followers_url":"https://api.github.com/users/LilithWittmann/followers","following_url":"https://api.github.com/users/LilithWittmann/following{/other_user}","gists_url":"https://api.github.com/users/LilithWittmann/gists{/gist_id}","starred_url":"https://api.github.com/users/LilithWittmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LilithWittmann/subscriptions","organizations_url":"https://api.github.com/users/LilithWittmann/orgs","repos_url":"https://api.github.com/users/LilithWittmann/repos","events_url":"https://api.github.com/users/LilithWittmann/events{/privacy}","received_events_url":"https://api.github.com/users/LilithWittmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-17T17:43:24Z","updated_at":"2015-09-17T17:43:24Z","closed_at":null,"body":"I tried to use the charts function of airflow but every query I run returns an internal server error. I think it has something to do with json encoding of the pandas object. \r\nMy system:\r\n- centos 7\r\n- python 3.4\r\n- airflow 1.5.1\r\n- postgresql 9.4\r\n```\r\nTraceback (most recent call last):\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/flask/app.py\", line 1817, in wsgi_app\r\n    response = self.full_dispatch_request()\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/flask/app.py\", line 1477, in full_dispatch_request\r\n    rv = self.handle_user_exception(e)\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/flask/app.py\", line 1381, in handle_user_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/flask/_compat.py\", line 33, in reraise\r\n    raise value\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/flask/app.py\", line 1475, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/flask/app.py\", line 1461, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/flask_admin/base.py\", line 68, in inner\r\n    return self._run_view(f, *args, **kwargs)\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/flask_admin/base.py\", line 359, in _run_view\r\n    return fn(self, *args, **kwargs)\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/airflow/www/app.py\", line 112, in decorated_function\r\n    return f(*args, **kwargs)\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/airflow/www/utils.py\", line 96, in view_func\r\n    return f(*args, **kwargs)\r\n  File \"/var/www/airflow/env/lib/python3.4/site-packages/airflow/www/app.py\", line 607, in chart_data\r\n    response=json.dumps(payload, indent=4, default=date_handler),\r\n  File \"/usr/lib64/python3.4/json/__init__.py\", line 237, in dumps\r\n    **kw).encode(obj)\r\n  File \"/usr/lib64/python3.4/json/encoder.py\", line 194, in encode\r\n    chunks = list(chunks)\r\n  File \"/usr/lib64/python3.4/json/encoder.py\", line 422, in _iterencode\r\n    yield from _iterencode_dict(o, _current_indent_level)\r\n  File \"/usr/lib64/python3.4/json/encoder.py\", line 396, in _iterencode_dict\r\n    yield from chunks\r\n  File \"/usr/lib64/python3.4/json/encoder.py\", line 396, in _iterencode_dict\r\n    yield from chunks\r\n  File \"/usr/lib64/python3.4/json/encoder.py\", line 317, in _iterencode_list\r\n    yield from chunks\r\n  File \"/usr/lib64/python3.4/json/encoder.py\", line 430, in _iterencode\r\n    yield from _iterencode(o, _current_indent_level)\r\n  File \"/usr/lib64/python3.4/json/encoder.py\", line 427, in _iterencode\r\n    raise ValueError(\"Circular reference detected\")\r\nValueError: Circular reference detected\r\n```\r\n\r\nThis is the object that can't be encoded:\r\n````\r\n{'columns': [{'title': 'year'}, {'title': 'price'}], 'data': [[2000.0, 9900.2], [2010.0, 76666.2], [2011.0, 3432.3], [2012.0, 5444.2], [2013.0, 2345.332], [2014.0, 34444.33], [2015.0, 414.4027888224663]], 'index': [0, 1, 2, 3, 4, 5, 6]}\r\n````\r\n"}}