dosubot[bot] commented on issue #37246: URL: https://github.com/apache/superset/issues/37246#issuecomment-3767754708
<!-- Answer --> This is a known bug in Superset 6.0.0: the time filter for "current/last week" generates SQL like `A <= col < B`, which is not standard SQL and fails on most databases. The correct SQL should use `col BETWEEN A AND B` or `col >= A AND col < B`. This bug was fixed in a later release ([details](https://github.com/apache/superset/issues/36776)). There are no configuration options in 6.0.0 to revert to the old SQL generation logic. If you can't upgrade, the main workarounds are: use a virtual dataset with custom SQL to handle the time range, adjust your dataset definition to cast or format datetime values to match your backend's expectations, or override the default time grain expression for your database engine if possible. If you let me know your database backend, I can suggest more specific workarounds. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/47767acc-a462-4807-9f56-f0a91ac938ce?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/47767acc-a462-4807-9f56-f0a91ac938ce?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/47767acc-a462-4807-9f56-f0a91ac938ce?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/47767acc-a462-4807-9f56-f0a91ac938ce?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/47767acc-a462-4807-9f56-f0a91ac938ce?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/47767acc-a462-4807-9f56-f0a91ac938ce?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/47767acc-a462-4807-9f56-f0a91ac938ce?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=This%20is%20a%20known%20bug%20in%20Superset%206.0.0%3A%20the%20time%20filter%20for%20%22current/last%20week%22%20generates%20SQL%20like%20%60A%20%3C%3D%20col%20%3C%20B%60%2C%20which%20is%20not%20standard%20SQL%20and%20fails%20on%20most%20databases.%20The%20correct%20SQL%20should%20use%20%60col%20BETWEEN%20A%20AND%20B%60%20or%20%60col%20%3E%3D%20A%20AND%20col%20%3C%20B%60.%20This%20bug%20was%20fixed%20in%20a%20later%20release%20%28%5Bdetails%5D%28https%3A//github.com/apache/superset/issues/36776%29%29.%0A%0AThere%20are%20no%20configuration%20options%20in%206.0.0%20to%20revert%20to%20the%20old%20SQL%20generation%20logic.%20If%20you%20can%27t%20upgrade%2C%20the%20main%20workarounds%20are%3A%20use%20a%20virtual%20dataset%20with%20custom%20SQL%20to%20ha ndle%20the%20time%20range%2C%20adjust%20your%20dataset%20definition%20to%20cast%20or%20format%20datetime%20values%20to%20match%20your%20backend%27s%20expectations%2C%20or%20override%20the%20default%20time%20grain%20expression%20for%20your%20database%20engine%20if%20possible.%20If%20you%20let%20me%20know%20your%20database%20backend%2C%20I%20can%20suggest%20more%20specific%20workarounds.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37246) -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
