Skip to content
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

fix(query): handle bad timezone correctly #8657

Merged
merged 1 commit into from
Feb 9, 2023
Merged

fix(query): handle bad timezone correctly #8657

merged 1 commit into from
Feb 9, 2023

Conversation

mangalaman93
Copy link
Member

in Go 1.20, time.MarshalJSON function checks for time zone strictly wrt RFC 3339 i.e. zone ∈ [0, 23]. In Dgraph, we have been simply following what time package has been doing and we need to handle the bad time zones gracefully now.

The way we handle it is that, we do not allow ingesting bad time zones going forward. Such a mutation will return an error. On the other hand, if data is already ingested, we return the result as is and ensure that such a query does not fail.

harshil-goel
harshil-goel previously approved these changes Feb 8, 2023
query/outputnode.go Outdated Show resolved Hide resolved
matthewmcneely
matthewmcneely previously approved these changes Feb 8, 2023
@coveralls
Copy link

coveralls commented Feb 9, 2023

Coverage Status

Coverage: 66.855% (-0.05%) from 66.901% when pulling 6c5c295 on aman/go120 into c477e57 on main.

all-seeing-code
all-seeing-code previously approved these changes Feb 9, 2023
harshil-goel
harshil-goel previously approved these changes Feb 9, 2023
In Go 1.20, time.MarshalJSON function checks for time zone strictly
wrt RFC 3339 i.e. zone ∈ [0, 23]. In Dgraph, we have been simply
following what time package has been doing and we need to handle
the bad time zones gracefully now.

The way we handle it is that, we do not allow ingesting bad time
zones going forward. Such a mutation will return an error. On the
other hand, if data is already ingested, we return the result as
is and ensure that such a query does not fail.
types/scalar_types.go Show resolved Hide resolved
Copy link
Contributor

@skrdgraph skrdgraph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @rarvikar

This looks okay.

The plan is as follows:

  • merge this
  • this PR will not break reads
  • this PR will need a communication in the next release, indicating writes would error out

If customers need a fix for the write, we will make a patch release (as this is an anti-pattern for go-standards).

@mangalaman93 mangalaman93 merged commit 8e9082a into main Feb 9, 2023
@mangalaman93 mangalaman93 deleted the aman/go120 branch February 9, 2023 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants