-
Notifications
You must be signed in to change notification settings - Fork 73
Transformation into data class corrupts TimeZones of Instant #1047
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
Comments
I guess I could figure out how to change the implementation to fail (probably boils down to remove the respective converter somewhere). I am not sure if I could figure out how implement the "automagical instant detection" approach. |
Hi @martinitus, thanks for letting us know! I see you're using the new experimental Normally, DataFrame uses the parse operation in the order described in the docs, so val column = columnOf("2024-12-12T13:00:00+01:00").parse()
println(column.type()) // Instant However, for the new This looks correct to me; it's just that, since Deephaven cannot create You can skip Deephaven's type inference for any column by providing a I do agree that it's confusing to have two different "defaults" for inference of types. The user shouldn't have to worry about which implementation is used to infer types and the results should be predictable. We already disable the Deephaven LocalDateTime parser whenever a user provides a non-US Locale, a dateTime pattern, or -formatter, but I suppose, we can disable it altogether unless a user explicitly provides |
Hi @Jolanrensen thanks for the elaborate feedback - sorry for the late answer (vacation ;-))! I like the changes in f42bd58! Not to do type inference and have the user do that explicitly to avoid nasty bugs caused by insensitive defaults always sounds good to me! That said, I already suspected that this has to do with Java not providing an Instant type and hence doing a roundtrip through some "datetime without timezone" type. That would mean, that there might be another issue hidden in the |
Reproduction:
This outputs:
Changing the dateTimeFormatter (*2) has no effect on the test outcome.
Explicitly telling the parser to parse as Instant (*1) fixes the issue.
However, following the principle of least surprise IMHO it would be A LOT better to:
The text was updated successfully, but these errors were encountered: