betodealmeida / gsheets-db-api

A Python DB-API and SQLAlchemy dialect to Google Spreasheets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't get time granularity using GSHEET driver in Superset.

eugeniamz opened this issue · comments

When doing a query in Superset with time granularity, the query fails.

SELECT DATETIME(STRFTIME('%Y-%m-%dT%H:00:00', "DateTime")) AS __timestamp,
       COUNT(*) AS count
FROM "https://docs.google.com/spreadsheets/d/1x5q4jaX54Ob0aT-0rBbECv_Q9xwqiYR41LwYVSwgavE/edit?usp=sharing"
WHERE "DateTime" >= '2020-04-16 00:00:00.000000'
  AND "DateTime" < '2020-04-23 00:00:00.000000'
GROUP BY DATETIME(STRFTIME('%Y-%m-%dT%H:00:00', "DateTime"))
ORDER BY count DESC
LIMIT 10000;

image