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
I got AttributeError: 'NoneType' object has no attribute 'get' in SQL Lab only when I tried to get timezone fields with Fixed Timezone.
This is the sql table definition i'm trying to use
CREATETABLEsales
(
id serialNOT NULL,
sale_date timestamp with time zone,
id_item integer,
id_store integer,
receipt_number bigint,
qty integer,
net_value double precision,
gross_value double precision,
CONSTRAINT sales_pkey PRIMARY KEY (id),
CONSTRAINT item_id_fk FOREIGN KEY (id_item)
REFERENCES item (id) MATCH SIMPLE
ONUPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT store_id_fk FOREIGN KEY (id_store)
REFERENCES store (id) MATCH SIMPLE
ONUPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED
)
If i run a simple query in SQL Lab like SELECT id,qty FROM sales LIMIT 10 all was fine; but when i add the sale_date column in the fields SELECT id,qty,sale_date FROM sales LIMIT 10 this error appears:
File "...../lib/python3.5/site-packages/superset/views/core.py", line 2055, in sql_json
if data.get('status') == QueryStatus.FAILED:
AttributeError: 'NoneType' object has no attribute 'get'
The same query works fine through the psql client and also via sqlalchemy:
The only way to make it works in the SQL Lab is casting the sale_date field to char e.g.:
otherwise
Superset version: 0.18.5
Python: 3.5.2
DB Backend: PGSql with psycopg2 module
The text was updated successfully, but these errors were encountered:
ernestoarbitrio
changed the title
timestamp with time zone field got AttributeError: 'NoneType' object has no attribute 'get'
[SQL Lab] timestamp with time zone field got AttributeError: 'NoneType' object has no attribute 'get'
Jul 17, 2017
I got
AttributeError: 'NoneType' object has no attribute 'get'
in SQL Lab only when I tried to get timezone fields with Fixed Timezone.This is the sql table definition i'm trying to use
If i run a simple query in SQL Lab like
SELECT id,qty FROM sales LIMIT 10
all was fine; but when i add thesale_date
column in the fieldsSELECT id,qty,sale_date FROM sales LIMIT 10
this error appears:The same query works fine through the
psql
client and also viasqlalchemy
:The only way to make it works in the SQL Lab is casting the sale_date field to char e.g.:
otherwise
Superset version: 0.18.5
Python: 3.5.2
DB Backend: PGSql with psycopg2 module
The text was updated successfully, but these errors were encountered: