Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time series line bar sqlalchemy.exc.ProgrammingError #661

Closed
chejinye opened this issue Jun 23, 2016 · 4 comments
Closed

time series line bar sqlalchemy.exc.ProgrammingError #661

chejinye opened this issue Jun 23, 2016 · 4 comments
Labels
inactive Inactive for >= 30 days

Comments

@chejinye
Copy link

sqlalchemy.exc.ProgrammingError

ProgrammingError: (psycopg2.ProgrammingError) column "\u6d4b\u8bd5\u5b57\u6bb5" does not exist
LINE 1: SELECT "\u6d4b\u8bd5\u5b57\u6bb5" AS timestamp, COUNT() AS ...
^
[SQL: 'SELECT "\u6d4b\u8bd5\u5b57\u6bb5" AS timestamp, COUNT(
) AS count \nFROM servcode_table_view \nWHERE "\xe6\xb5\x8b\xe8\xaf\x95\xe5\xad\x97\xe6\xae\xb5" >= '2010-06-23 11:01:48.000000' AND "\xe6\xb5\x8b\xe8\xaf\x95\xe5\xad\x97\xe6\xae\xb5" <= '2016-06-23 11:01:48.000000' GROUP BY "\u6d4b\u8bd5\u5b57\u6bb5" \n LIMIT 50000']
Traceback (most recent call last)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__

return self.wsgi_app(environ, start_response)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app

response = self.make_response(self.handle_exception(e))

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception

reraise(exc_type, exc_value, tb)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app

response = self.full_dispatch_request()

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request

rv = self.handle_user_exception(e)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception

reraise(exc_type, exc_value, tb)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request

rv = self.dispatch_request()

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request

return self.view_functions[rule.endpoint](**req.view_args)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/flask_appbuilder/security/decorators.py", line 26, in wraps

return f(self, *args, **kwargs)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/caravel/models.py", line 1295, in wrapper

return f(*args, **kwargs)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/caravel/views.py", line 558, in explore

payload = obj.get_json()

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/caravel/viz.py", line 262, in get_json

'data': self.get_data(),

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/caravel/viz.py", line 961, in get_data

df = self.get_df()

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/caravel/viz.py", line 869, in get_df

df = super(NVD3TimeSeriesViz, self).get_df(query_obj)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/caravel/viz.py", line 148, in get_df

self.results = self.datasource.query(**query_obj)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/caravel/models.py", line 726, in query

con=engine

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/pandas/io/sql.py", line 433, in read_sql_query

parse_dates=parse_dates, chunksize=chunksize)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/pandas/io/sql.py", line 1192, in read_query

result = self.execute(*args)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/pandas/io/sql.py", line 1083, in execute

return self.connectable.execute(*args, **kwargs)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1991, in execute

return connection.execute(statement, *multiparams, **params)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 906, in execute

return self._execute_text(object, multiparams, params)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1054, in _execute_text

statement, parameters

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context

context)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception

exc_info

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause

reraise(type(exception), exception, tb=exc_tb, cause=cause)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context

context)

File "/home/chejinye/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute

cursor.execute(statement, parameters)

ProgrammingError: (psycopg2.ProgrammingError) column "\u6d4b\u8bd5\u5b57\u6bb5" does not exist LINE 1: SELECT "\u6d4b\u8bd5\u5b57\u6bb5" AS timestamp, COUNT(*) AS ... ^ [SQL: 'SELECT "\\u6d4b\\u8bd5\\u5b57\\u6bb5" AS timestamp, COUNT(*) AS count \nFROM servcode_table_view \nWHERE "\xe6\xb5\x8b\xe8\xaf\x95\xe5\xad\x97\xe6\xae\xb5" >= \'2010-06-23 11:01:48.000000\' AND "\xe6\xb5\x8b\xe8\xaf\x95\xe5\xad\x97\xe6\xae\xb5" <= \'2016-06-23 11:01:48.000000\' GROUP BY "\\u6d4b\\u8bd5\\u5b57\\u6bb5" \n LIMIT 50000']

The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.

To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

dump() shows all variables in the frame
dump(obj) dumps all that's known about the object
@chejinye
Copy link
Author

Where the SQL statement is generated

@mistercrunch
Copy link
Member

Looks like you're pretty deep into unicode. You might want to give python3 a shot.

@chejinye
Copy link
Author

chejinye commented Jun 27, 2016

../python2.7/site-packages/sqlalchemy/elements.py
def str(self) ascii update to utf8 can solve @mistercrunch

@mistercrunch
Copy link
Member

I have no idea what that means

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive Inactive for >= 30 days
Projects
None yet
Development

No branches or pull requests

4 participants