-
Notifications
You must be signed in to change notification settings - Fork 77
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
Rascal and JSON/CVS libraries do not support partial datetime (time without date and vice versa) or time offsets (they are normalized to instants) #1533
Comments
related: #1508 On that branch I also fixed some of the parsing bugs in our implementation for time or date only literals. I think it's a hole in our value type tree that two datetimes sometimes throw exceptions when you compare then against eachother. |
In what way was that branch still a work in progress? The current situation is very simple:
Since there are many issues related to datetime that still need serious consideration (design) and fixing, the best might be Another solution in my mind requires either splitting Is there a third option that I am missing @DavyLandman @PaulKlint @tvdstorm ? |
My current ideas go to a temporary change in the vallang library like so:
That way the vallang library can use |
Ok. ran a test and that would solve half of the issues Next issue: the Rascal implementation does not deal well with zone offsets:
That's another kind of random datetime value that was not generated before, but it is now. I'll look into the details to see if this can be fixed at the Rascal side |
Ah. We loose offsets when writing/reading JSON like this:
|
?
and has
not supported on datetime fields
okay, so my branch solves quite some of those serialization bugs. (there are quite a few) but, I stopped since there is this problem of not all datetimes being equal. I think adding a field that limits the random generator is a nice approach to keep going. But I do think we need to consider splitting up datetime into |
Very much agreed. Now working on Zulu time issues. |
Describe the bug
Given the issues identified in RAP 11: https://docs.google.com/document/d/1xXRZnPBifewgKs57mRYBI75QjSF5Hg-Lw9tQ_STWtQQ/edit
it is important that programmers can check if a
year
field (for example) is present or not. That would also be consistentgiven the way we treat the fields of values of the
loc
type.Currently however,
datetime
has many fields but none of them are supported by the?
andhas
operators.There are also issues with zone offsets while reading/writing them in JSON and CSV. The offset information is normalized to the instanst that it represents.
See also RAP11: Rascal and Vallang should keep datetime values immutable, and have different values for when the zone offsets or zone names are different. Even though this would make "equal" instants different, that would allow data/code scientists in Rascal to faithfully deal with such discrepancies and make choices based on the context that they are in.
The text was updated successfully, but these errors were encountered: