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

[Go] Time to Date32 / Date64 conversion incorrect for non-UTC timezone #39672

Closed
zeroshade opened this issue Jan 17, 2024 · 0 comments · Fixed by #39674
Closed

[Go] Time to Date32 / Date64 conversion incorrect for non-UTC timezone #39672

zeroshade opened this issue Jan 17, 2024 · 0 comments · Fixed by #39674
Assignees
Milestone

Comments

@zeroshade
Copy link
Member

Describe the bug, including details regarding any error messages, version, and platform.

During release verification, a unit test was failing with:

ok      [github.com/apache/arrow/go/v15/arrow/flight/flightsql](http://github.com/apache/arrow/go/v15/arrow/flight/flightsql)   4.990s
1970-01-01 12:00:00 +0000 UTC
--- FAIL: Test_fromArrowType (0.00s)
    --- FAIL: Test_fromArrowType/fromArrowType_date64_f16-d64 (0.00s)
        utils_test.go:104: test failed, wanted time.Time 2024-01-17
00:00:00 +0000 UTC got time.Time 2024-01-18 00:00:00 +0000 UTC
FAIL
FAIL    [github.com/apache/arrow/go/v15/arrow/flight/flightsql/driver](http://github.com/apache/arrow/go/v15/arrow/flight/flightsql/driver)
 5.821s

Component(s)

Go

zeroshade added a commit to zeroshade/arrow that referenced this issue Jan 17, 2024
@raulcd raulcd added this to the 15.0.1 milestone Jan 18, 2024
zeroshade added a commit that referenced this issue Jan 18, 2024
…mezones (#39674)

A failing unit test in release verification led to discovering an issue with timestamp to date conversions for non-utc timezones. 

Upon some investigation I was able to determine that it was the conflation of casting conversion behavior (normalize to cast a Timestamp to a Date) vs flat conversion. I've fixed this conflation of concerns and the version of the methods which are exported properly converts non-UTC timezones to dates without affecting Casting behavior.

### Are these changes tested?
yes

### Are there any user-facing changes?
The methods `Date32FromTime` and `Date64FromTime` will properly handle timezones now.

* Closes: #39672

Authored-by: Matt Topol <zotthewizard@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
@zeroshade zeroshade modified the milestones: 15.0.1, 16.0.0 Jan 18, 2024
clayburn pushed a commit to clayburn/arrow that referenced this issue Jan 23, 2024
…UTC timezones (apache#39674)

A failing unit test in release verification led to discovering an issue with timestamp to date conversions for non-utc timezones. 

Upon some investigation I was able to determine that it was the conflation of casting conversion behavior (normalize to cast a Timestamp to a Date) vs flat conversion. I've fixed this conflation of concerns and the version of the methods which are exported properly converts non-UTC timezones to dates without affecting Casting behavior.

### Are these changes tested?
yes

### Are there any user-facing changes?
The methods `Date32FromTime` and `Date64FromTime` will properly handle timezones now.

* Closes: apache#39672

Authored-by: Matt Topol <zotthewizard@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
dgreiss pushed a commit to dgreiss/arrow that referenced this issue Feb 19, 2024
…UTC timezones (apache#39674)

A failing unit test in release verification led to discovering an issue with timestamp to date conversions for non-utc timezones. 

Upon some investigation I was able to determine that it was the conflation of casting conversion behavior (normalize to cast a Timestamp to a Date) vs flat conversion. I've fixed this conflation of concerns and the version of the methods which are exported properly converts non-UTC timezones to dates without affecting Casting behavior.

### Are these changes tested?
yes

### Are there any user-facing changes?
The methods `Date32FromTime` and `Date64FromTime` will properly handle timezones now.

* Closes: apache#39672

Authored-by: Matt Topol <zotthewizard@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
raulcd pushed a commit that referenced this issue Feb 20, 2024
…mezones (#39674)

A failing unit test in release verification led to discovering an issue with timestamp to date conversions for non-utc timezones. 

Upon some investigation I was able to determine that it was the conflation of casting conversion behavior (normalize to cast a Timestamp to a Date) vs flat conversion. I've fixed this conflation of concerns and the version of the methods which are exported properly converts non-UTC timezones to dates without affecting Casting behavior.

### Are these changes tested?
yes

### Are there any user-facing changes?
The methods `Date32FromTime` and `Date64FromTime` will properly handle timezones now.

* Closes: #39672

Authored-by: Matt Topol <zotthewizard@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this issue Feb 28, 2024
…UTC timezones (apache#39674)

A failing unit test in release verification led to discovering an issue with timestamp to date conversions for non-utc timezones. 

Upon some investigation I was able to determine that it was the conflation of casting conversion behavior (normalize to cast a Timestamp to a Date) vs flat conversion. I've fixed this conflation of concerns and the version of the methods which are exported properly converts non-UTC timezones to dates without affecting Casting behavior.

### Are these changes tested?
yes

### Are there any user-facing changes?
The methods `Date32FromTime` and `Date64FromTime` will properly handle timezones now.

* Closes: apache#39672

Authored-by: Matt Topol <zotthewizard@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
thisisnic pushed a commit to thisisnic/arrow that referenced this issue Mar 8, 2024
…UTC timezones (apache#39674)

A failing unit test in release verification led to discovering an issue with timestamp to date conversions for non-utc timezones. 

Upon some investigation I was able to determine that it was the conflation of casting conversion behavior (normalize to cast a Timestamp to a Date) vs flat conversion. I've fixed this conflation of concerns and the version of the methods which are exported properly converts non-UTC timezones to dates without affecting Casting behavior.

### Are these changes tested?
yes

### Are there any user-facing changes?
The methods `Date32FromTime` and `Date64FromTime` will properly handle timezones now.

* Closes: apache#39672

Authored-by: Matt Topol <zotthewizard@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants