-
Notifications
You must be signed in to change notification settings - Fork 323
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
A Time_Of_Day
represented by java.time.LocalTime
fails TypesGen.expectEnsoTimeOfDay
check
#6912
Comments
Looks like this may likely be some polyglot issue since the 'parsed' date comes from a column so it goes through a Java boundary. Indeed, nothing to do with parsing:
yields
|
Time_Of_Day
coming from a Table
fails a Time_Of_Day
typecheck
Both values happily answer
It seems to be some issue with how the builtin dispatch handles polyglot conversions. Date's |
A repro with no
|
The problem isn't caused by This problem has been there since ages, I think. In short the
The to_time_builtin expects |
Time_Of_Day
coming from a Table
fails a Time_Of_Day
typecheckTime_Of_Day
represented by java.time.LocalTime
fails TypesGen.expectEnsoTimeOfDay
check
Related to #6912 It essentially solves it by removing any builtins that would take an EnsoDate/EnsoTimeOfDay/EnsoTimeZone and replacing them with Java utils that do the same operation. This is not a proper solution - the builtin conversion is still invalid for the date/time types - but at this moment we may just no longer use the invalid conversion so it is much less of an issue. We still need to be aware of this if we want to introduce builtins taking date/time in the future.
The given example seems to work. Certainly since #7344 |
I think we should add some unit tests to avoid regressing this in the future. |
Ah, I realised - of course the problem is not visible, because we've got a workaround in! #6964 |
You are welcomed to update steps to reproduce and reopen the issue. Update:
Yes, these conversions are not ideal, but when the code got fixed by removing the builtin, then we can live with that, I think. |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-07-24): Progress: - #7344
Next Day: Bugfixes & cleanup
|
A
Time_Of_Day
should behave the same regardless of its source. But that is not the case.Run this snippet:
Expected behaviour
Both cases should work exactly the same:
Actual behaviour
The error is particularly friendly, since the expected and actual types are the same 😅
The text was updated successfully, but these errors were encountered: