betodealmeida / shillelagh

Making it easy to query APIs via SQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to use filter When superset + shillelagh to get data from api

j491424570 opened this issue · comments

I installed shillelagh on superset to get data from api
I am running weatherapi demo and datasettes demo which works fine
but filter function seemed not working. How to make superset filter working?
Any suggestions are welcome

SQL on superset:
SELECT * FROM "https://san-francisco.datasettes.com/sf-trees/Street_Tree_List" LIMIT 5
filter1
filter not working

Huh, weird, it should've worked — you're doing everything correctly. Let me take a look.

@j491424570 can you share the query that Superset is generating? In the chart builder you can click on the triple dots in the top right (near the "save" button), and see the query.

I try to build the query manually and it seems to work:

sql> SELECT qLegalStatus, qSpecies, qAddress, SiteOrder, COUNT(TreeID) FROM "https://san-francisco.datasettes.com/sf-trees/Street_Tree_List" WHERE qLegalStatus >= 2;
  qLegalStatus    qSpecies  qAddress            SiteOrder    COUNT(TreeID)
--------------  ----------  ----------------  -----------  ---------------
             2           2  940 Elizabeth St            1           128742

Curious if Superset is building a different query.

Did you click "update chart" after adding the filter? I think that could be the problem.

It's working fine for me:

Screenshot 2023-05-23 at 16-15-38 Preset

Closing, feel free to reopen if the problem happens again.