Bug description

When I use the [Map], the time filter selection 'Current Day' seems to have incorrect time parameters in the SQL template. However, when switching to the [Table] view with the same conditions, the SQL template executes correctly.

  1. This is a virtual dataset using SQL templates: from_dttm and to_dttm. iShot_2024-12-05_11 09 47

  2. I used the [map] to display the data, selected 'Current Day' for the time filter, but couldn't retrieve any data. When I entered the SQL toolbox to execute it, I found that the time parameter was incorrect. iShot_2024-12-05_11 10 41 iShot_2024-12-05_11 10 52 iShot_2024-12-05_11 11 11

  3. However, when I switch to displaying the data in a [table], everything seems to be normal. iShot_2024-12-05_11 11 36 iShot_2024-12-05_11 11 50

Screenshots/recordings

No response

Superset version

4.1.1

Python version

3.10

Node version

I don't know

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.

Comment From: dosubot[bot]

Hey there, @big-mouth-cn! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together!

The issue you're experiencing with the 'Current Day' time filter in Map visualizations might be related to how Superset processes SQL templates for different visualization types. While I couldn't find specific details about differences in SQL template processing between Map and Table visualizations, it's possible that the Map visualization is not correctly interpreting the from_dttm and to_dttm parameters for the 'Current Day' selection.

In Superset, these parameters are used to define the start and end datetime for a query, and they are typically set based on the time range settings in the form data. If there is a discrepancy in how these parameters are handled between different visualization types, it could lead to issues like the one you're encountering [1].

To troubleshoot this issue, you might want to:

  1. Verify the SQL query generated for both Map and Table visualizations to see if there are any differences in how the time parameters are applied.
  2. Check if there are any specific configurations or settings in Superset that affect time filters for Map visualizations, although I couldn't find specific information on this [2].
  3. Consider using the get_time_filter macro, which provides a more flexible way to handle time filters and might help resolve discrepancies [2].

If the issue persists, reviewing the Superset logs for any errors or warnings related to time filtering might provide additional insights.

To continue talking to Dosu, mention @dosu.

Comment From: rusackas

Are you still facing this one? It's been silent for quite a while... maybe we need an example query with an example dataset, so we can better reproduce the issue.

Comment From: rusackas

We haven't heard back with any further updates, so we'll call this not-planned for now, but I/we are more than happy to reopen if we can reproduce it (in 5.0.0 or on master)