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

Problem with assert referenced columns are present in datasource #11078

Closed
lilila opened this issue Sep 26, 2020 · 6 comments · Fixed by #11112
Closed

Problem with assert referenced columns are present in datasource #11078

lilila opened this issue Sep 26, 2020 · 6 comments · Fixed by #11112
Assignees
Labels
!deprecated-label:bug Deprecated label - Use #bug instead

Comments

@lilila
Copy link

lilila commented Sep 26, 2020

@villebro , I have an issue with #10451

It breaks the following type of jinja-based filters:

{% set min_tracking  = filter_values('min_sem_tracking', -9 )[0] %} 
{% set max_tracking = filter_values('max_sem_tracking', 2 )[0]  %} 


SELECT 
...
WHERE 
sem_tracking > {min_tracking} AND sem_tracking < {max_tracking} 
@lilila lilila added the !deprecated-label:bug Deprecated label - Use #bug instead label Sep 26, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.96. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@villebro villebro self-assigned this Sep 27, 2020
@villebro
Copy link
Member

Thanks for posting this issue @lilila . Can you post some more details on how to reproduce the error?

@lilila
Copy link
Author

lilila commented Sep 28, 2020

Hi Villebro,
If I want to add a min / max filter on a field (since the filter box does not allow this) I usually create a SQL Lab view as follows :

SELECT -5 as min_sem_tracking, 1 as max_sem_tracking
Then I create a filter box with the 2 fields created in this "fake" table :
Screenshot 2020-09-28 at 06 35 50

After adding the filter box in the dashboard I use the user input value for min and max value to create more "complex" filters on another table. As explain above I collect user inputs using filter_values

{% set min_tracking  = filter_values('min_sem_tracking', -9 )[0] %} 
{% set max_tracking = filter_values('max_sem_tracking', 2 )[0]  %} 

Then I use the collected values to create filters on another field in another table :

SELECT * FROM my_table 
WHERE 
sem_tracking > {min_tracking} AND sem_tracking < {max_tracking} 

With the new restriction, I receive an error message saying min_sem_tracking and max_sem_tracking are not in the datasource.

@villebro
Copy link
Member

I was able to reproduce, thanks @lilila and @bkyryliuk for helping track this down. Working on a fix now.

@lilila
Copy link
Author

lilila commented Jan 13, 2021

Hi @villebro , I hope you are doing well.
I tried the new release (1.0.rc1) and I have the impression the problem is back. All "artificial filters " (such as min / max values) generate warnings. In the end I end up with a dashboard looking like this :
Screenshot 2021-01-13 at 10 18 45

@villebro
Copy link
Member

@lilila is the behavior consistent? There is a problem that causes chart loading errors on 1.0.0rc1 that should be fixed by this PR: #12489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants