You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/12/24 08:30:44 UTC

[GitHub] [incubator-superset] saurabh1-singh opened a new issue #8892: Jinja Template not working in case of view query

saurabh1-singh opened a new issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892
 
 
   When I put the jinja template inside a filter after selecting a table data source directly and then use a filter box to fill those values at runtime it works fine. But when I create a advanced query i.e. view, then the same thing does not work.
   ![Screenshot from 2019-12-24 13-51-04](https://user-images.githubusercontent.com/42036742/71403279-3fa3da80-2655-11ea-9cc3-9205f839951f.png)
   
   In the above screenshot you can see the char test_char is loaded fine but not the test_c_1
   
   ![Screenshot from 2019-12-24 13-54-04](https://user-images.githubusercontent.com/42036742/71403282-403c7100-2655-11ea-88f0-90f6ab356910.png)
   
   The above one is test_c_1 with a advanced query/view
   
   ![Screenshot from 2019-12-24 13-55-08](https://user-images.githubusercontent.com/42036742/71403283-403c7100-2655-11ea-81b3-88f4af2bc0fc.png)
   
   
   ### Expected results
   
   I expected both to work similarly
   
   ### Actual results
   
   Did not happen in case of view it also creates an extra filter with the name of the filter in filter box and try it apply it too
   
   #### Screenshots
   
   If applicable, add screenshots to help explain your problem.
   
   #### How to reproduce the bug
   
   1. Go to '...'
   2. Click on '....'
   3. Scroll down to '....'
   4. See error
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: `superset version`
   - python version: `python --version`
   - node.js version: `node -v`
   - npm version: `npm -v`
   
   ### Checklist
   
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version of superset.
   - [ ] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   Add any other context about the problem here.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] saurabh1-singh commented on issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
saurabh1-singh commented on issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892#issuecomment-568902974
 
 
   @villebro i did look at the query generated here is the diff
   
   - In the chart which shows error test_c_1, the query generated is as follows
   `SELECT user_id AS user_id
   FROM
     (select user_id,
             score
      FROM chqbook.fact_credit_profile_agg) AS expr_qry
   WHERE score_1 IN (700)
     AND score_2 IN (800)
     AND ((score >= '700'
           and score <= '800'))
   LIMIT 1000;`
   
   - While in the second chart its
   `SELECT report_id AS report_id,
          score AS score
   FROM chqbook.dim_credit_reports
   WHERE ((score >= '700'
           and score <= '800'))
   LIMIT 250;`
   
   As you can see here what i am trying to point out using a view on the datasource makes it fill the value in the template as well as apply the filter, while using the table directly as datasource does not add extra filter

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] villebro commented on issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
villebro commented on issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892#issuecomment-569283641
 
 
   @saurabh1-singh thanks for the additional context. If I understand what you've done, you're doing something pretty clever with the filter box, for which it hasn't really been designed. Or rather, the problem isn't so much the filter box itself, but the fact that the `filter_values` function you're calling is referencing columns that are not available in your datasource. I think it might be possible to leave any columns that aren't present in the datasource from the additional filters generated by the function. Let me think about this for a second.
   
   Ultimately thought, I think you're actually looking for something similar to what's discussed in #8452 , i.e. a component that makes it possible to define more fine grained filtering than is currently offered by existing components. Am I correct?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] issue-label-bot[bot] commented on issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
issue-label-bot[bot] commented on issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892#issuecomment-568692829
 
 
   Issue-Label Bot is automatically applying the label `#bug` to this issue, with a confidence of 0.93. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback! 
   
    Links: [app homepage](https://github.com/marketplace/issue-label-bot), [dashboard](https://mlbot.net/data/apache/incubator-superset) and [code](https://github.com/hamelsmu/MLapp) for this bot.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] saurabh1-singh commented on issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
saurabh1-singh commented on issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892#issuecomment-570130390
 
 
   @villebro Yes you can say that its a hack for something similar to #8452 . Do you know about when can we expect the work to be done for #8452 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] stale[bot] closed issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
stale[bot] closed issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] villebro commented on issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
villebro commented on issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892#issuecomment-568699650
 
 
   You can look at the generated query to debug similar problems (right hand corner in Explore view). Can you post the generated query here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] stale[bot] commented on issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
stale[bot] commented on issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892#issuecomment-593251943
 
 
   This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue `.pinned` to prevent stale bot from closing the issue.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] villebro edited a comment on issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
villebro edited a comment on issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892#issuecomment-569283641
 
 
   @saurabh1-singh thanks for the additional context. If I understand what you've done, you're doing something pretty clever with the filter box, for which it hasn't really been designed. Or rather, the problem isn't so much the filter box itself, but the fact that the `filter_values` function you're calling is referencing columns that are not available in your datasource. I think it might be possible to leave any columns that aren't present in the datasource from the additional filters generated by the function. Let me think about this for a second.
   
   Ultimately though, I think you're actually looking for something similar to what's discussed in #8452 , i.e. a component that makes it possible to define more fine grained filtering than is currently offered by existing components. Am I correct?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] saurabh1-singh commented on issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
saurabh1-singh commented on issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892#issuecomment-569256488
 
 
   @villebro @mistercrunch can you guys help

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] saurabh1-singh edited a comment on issue #8892: Jinja Template not working in case of view query

Posted by GitBox <gi...@apache.org>.
saurabh1-singh edited a comment on issue #8892: Jinja Template not working in case of view query
URL: https://github.com/apache/incubator-superset/issues/8892#issuecomment-568902974
 
 
   @villebro i did look at the query generated here is the diff
   
   - In the chart which shows error test_c_1, the query generated is as follows
   `SELECT user_id AS user_id
   FROM
     (select user_id,
             score
      FROM table_1) AS expr_qry
   WHERE score_1 IN (700)
     AND score_2 IN (800)
     AND ((score >= '700'
           and score <= '800'))
   LIMIT 1000;`
   
   - While in the second chart its
   `SELECT user_id AS report_id,
          score AS score
   FROM table_1
   WHERE ((score >= '700'
           and score <= '800'))
   LIMIT 250;`
   
   As you can see here what i am trying to point out using a view on the datasource makes it fill the value in the template as well as apply the filter, while using the table directly as datasource does not add extra filter

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org