Giter VIP home page Giter VIP logo

Comments (2)

bshepherdson avatar bshepherdson commented on July 28, 2024

This is definitely DST-related. I suspect this is only a UI quirk, and not impacting the query results, but I'm not certain.

@osayedTFL Are you able to look at the Network tab for either the /api/card/1234 for this card, or a .../dataset request for this card? It would be helpful to see how this filter is represented internally. Also, what are the time zones here? (DST start/stop rules vary significantly.)

There's not really such a thing as a "date filter" for a datetime column - the filter will need to specify the exact times at the SQL level, something like date >= 2024-04-01T00:00:00 AND date < 2024-04-27T00:00:00.

But the latter time might not really exist, if DST skips the hour of midnight and the day begins at 1am. I think we're rendering this badly in two ways: (1) we're showing the time when we don't want to be, because one of the times is not midnight; and (2) making it look like the 26th isn't included, when the SQL might include it.

Time zones and DST are a perennial pain point in Metabase. There may be no perfect way to reconcile the time zones of (1) the query author, (2) the database being queried, and (3) the query viewer, but there's still a bug to clean up here.

from metabase.

osayedTFL avatar osayedTFL commented on July 28, 2024

Actually it does affect query results when filtering for 26 April specifically, especially as an "end date" in the field filter. All results for 26 April should show, but in this way it only shows results until 1 am on 26 april.
This is the day when the DST jump happened and you are correct, it was the case that the clock went straight from Midnight to 1 am. The timezone is Africa/Cairo or UTC +2. This still shouldn't happen as our db is set to UTC, but the "date" field here specifically has a data type of "DateTimeWithLocalTZ"

As for the network tab, I have here the payload of a "dataset" request.

As you can see, a "temporal unit" key is added in the field filter for some reason.
{"database":2,"type":"query","query":{"source-table":9,"filter":["between",["field",263,{"base-type":"type/DateTimeWithLocalTZ","temporal-unit":"minute"}],"2024-04-01T00:00:00","2024-04-26T01:00:00"]},"parameters":[]}

however, as stated before, this issue does not appear for everyone in my organization, when I open the request from their device, this is the payload that is sent, notice that no time units are used.
{"database":2,"type":"query","query":{"source-table":9,"filter":["between",["field",263,{"base-type":"type/DateTimeWithLocalTZ"}],"2024-04-01","2024-04-26"]},"parameters":[]}

Do let me know if you need any more information on my end and I appreciate the response.

from metabase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.