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

Cannot Apply Filter in Dashboard to Google Sheet Data Source #30413

Open
3 tasks done
volume8208 opened this issue Sep 27, 2024 · 6 comments
Open
3 tasks done

Cannot Apply Filter in Dashboard to Google Sheet Data Source #30413

volume8208 opened this issue Sep 27, 2024 · 6 comments
Labels
dashboard:filtersets Related to the filtersets of the Dashboard data:connect:googlesheets Related to Google Sheets

Comments

@volume8208
Copy link

Bug description

When using a Google Sheets data source in Superset, filters applied through the Dashboard's Filter UI are not working. System throw error "Error: Invalid query: NO_COLUMN: null". However, manually applying SQL WHERE filters in SQL Lab works as expected. This issue prevents the use of filters through the Dashboard's UI, significantly limiting the functionality for non-technical users who rely on the Filter UI.

How to reproduce the bug

  • Connect a Google Sheets data source to Superset.
  • Create a dashboard using this data source.
  • Add a filter to the dashboard through the Filter UI.
  • Observe that the filter does not apply correctly to the Google Sheets data.
  • Go to SQL Lab and manually apply a SQL WHERE clause to the same data source.
  • Observe that the filter works when applied through SQL Lab.

Screenshots/recordings

Screenshot 2567-09-27 at 13 58 17

Superset version

4.0.2

Python version

3.10

Node version

18 or greater

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Copy link

dosubot bot commented Sep 27, 2024

Hey @volume8208! I'm here to help you with the issue you're facing in Superset. I'm a bot designed to assist with bug resolutions, answer questions, and guide you on becoming a contributor. Let's dive into resolving the problem together!

The issue with filters applied through the Dashboard's Filter UI not working for a Google Sheets data source, while manually applying SQL WHERE filters in SQL Lab works as expected, is likely due to compatibility checks and scope management in the Dashboard's Filter UI.

  1. Compatibility Checks: The filters are checked for compatibility with the datasource. If the filters are incompatible, they are marked as IndicatorStatus.Incompatible and are not applied. This could be why the filters are not working when applied through the Dashboard's Filter UI [1].

  2. Scope Management: The function useSelectFiltersInScope ensures that only filters within the active scope of the dashboard are applied. If the filters are out of scope, they will not be applied [2].

  3. Error Handling: The error "NO_COLUMN: null" is generated when a column does not exist in the datasource. This is handled using the SupersetError class with the COLUMN_DOES_NOT_EXIST_ERROR type [3][4].

To address this issue, ensure that the filters are compatible with the Google Sheets data source and within the active scope of the dashboard. Additionally, verify that the columns referenced in the filters exist in the Google Sheets data source.

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added dashboard:filtersets Related to the filtersets of the Dashboard data:connect:googlesheets Related to Google Sheets labels Sep 27, 2024
@sundar68
Copy link

sundar68 commented Oct 7, 2024

@rusackas
Facing the same issue for Google Sheet Data Source.
Can you please provide any solution for this.

@volume8208
Copy link
Author

volume8208 commented Oct 7, 2024 via email

@sundar68
Copy link

sundar68 commented Oct 7, 2024

It's working fine for mysql and other data sources.

We have requirement for Google Sheet Data Source.

@etiennemallo
Copy link

Hey @sundar68

From what I see the filter in question is a date filter
I faced the same issue for date-like filters, and I just ended up creating a computed property like so :

= DATETIME()

Don't forget to modify the charts with your computed property

@ddobrinskiy
Copy link

facing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:filtersets Related to the filtersets of the Dashboard data:connect:googlesheets Related to Google Sheets
Projects
None yet
Development

No branches or pull requests

4 participants