You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Kevin Crouse (Jira)" <ji...@apache.org> on 2022/03/24 18:06:00 UTC
[jira] [Updated] (ARROW-16022) floor_temporal / ceil_temporal throws exception for existing timestamps if ambiguous/existing
[ https://issues.apache.org/jira/browse/ARROW-16022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Crouse updated ARROW-16022:
---------------------------------
Description:
Running pyarrow.compute.floor_temporal for timestamps that exist will throw exceptions if the times are ambiguous during the daylight savings time transitions.
As the *_temporal functions do not fundamentally change the times, it does not make sense that they would fail due to a timezone issue. If they must fail, it should be when the pyarrow.Timestamp is created.
{code:java}
import pyarrow
import pyarrow.compute as pc
import datetime
t = pyarrow.timestamp('s', tz='America/New_York')
dt = datetime.datetime(2013, 11, 3, 1, 3, 14, tzinfo = pytz.timezone('America/New_York'))
# if a timestamp must be invalid, this could fail
za = pyarrow.array([dt], t)
# raises an exception, even though this is conceptually an identity function
pc.floor_temporal(za, unit = 'second') {code}
was:
Running pyarrow.compute.floor_temporal for timestamps that exist will throw exceptions if the times are invalid.
As the *_temporal functions do not fundamentally change the times, it does not make sense that they would fail due to a timezone issue. If they must fail, it should be when the pyarrow.Timestamp is created.
{code:java}
import pyarrow
import pyarrow.compute as pc
import datetime
t = pyarrow.timestamp('s', tz='America/New_York')
dt = datetime.datetime(2013, 11, 3, 1, 3, 14, tzinfo = pytz.timezone('America/New_York'))
# if a timestamp must be invalid, this could fail
za = pyarrow.array([dt], t)
# raises an exception, even though this is conceptually an identity function
pc.floor_temporal(za, unit = 'second') {code}
> floor_temporal / ceil_temporal throws exception for existing timestamps if ambiguous/existing
> ---------------------------------------------------------------------------------------------
>
> Key: ARROW-16022
> URL: https://issues.apache.org/jira/browse/ARROW-16022
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Affects Versions: 7.0.0
> Reporter: Kevin Crouse
> Priority: Major
>
> Running pyarrow.compute.floor_temporal for timestamps that exist will throw exceptions if the times are ambiguous during the daylight savings time transitions.
> As the *_temporal functions do not fundamentally change the times, it does not make sense that they would fail due to a timezone issue. If they must fail, it should be when the pyarrow.Timestamp is created.
>
>
> {code:java}
> import pyarrow
> import pyarrow.compute as pc
> import datetime
> t = pyarrow.timestamp('s', tz='America/New_York')
> dt = datetime.datetime(2013, 11, 3, 1, 3, 14, tzinfo = pytz.timezone('America/New_York'))
> # if a timestamp must be invalid, this could fail
> za = pyarrow.array([dt], t)
> # raises an exception, even though this is conceptually an identity function
> pc.floor_temporal(za, unit = 'second') {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)