joemarshall commented on code in PR #37822:
URL: https://github.com/apache/arrow/pull/37822#discussion_r1636745634
##########
python/pyarrow/tests/test_compute.py:
##########
@@ -2481,6 +2493,10 @@ def _check_temporal_rounding(ts, values, unit):
@pytest.mark.skipif(sys.platform == "win32" and not util.windows_has_tzdata(),
reason="Timezone database is not installed on Windows")
[email protected](
+ sys.platform == "emscripten",
+ reason="Emscripten datetime is implemented in Javascript and works
differently"
+)
Review Comment:
Ah, I've got it, it's something to do with timezones and daylight saving, I
think it isn't actually in the emscripten javascript that the bug is happening.
I think there's an error with DST.
I can't work out where the bug is though, whether it is a bug in arrow that
only happens in emscripten, or an emscripten libc++ bug or what.
If I run the below code, which takes a timestamp near the daylight savings
time change, then pandas and arrow disagree as to whether some dates should be
dst or not.
```
import pyarrow as pa
import pyarrow.compute as pc
import pandas as pd
for x in range(0,20):
t=pd.to_datetime("%d-10-26 09:39:00.316686848+01:00
"%(x+1990)).tz_convert("Europe/London")
s=pa.scalar(t)
print(t,s,t.dst(),pc.is_dst(s))
```
Output looks like this
|Pandas_timestamp|Arrow_timestamp|pandasDST_offset|pyarrow_dst_offset|
|-----------|------------|--------------|-----------|
|1990-10-26 09:39:00.316686848+01:00|1990-10-26
09:39:00.316686+01:00|1:00:00|True|
|1991-10-26 09:39:00.316686848+01:00|1991-10-26
09:39:00.316686+01:00|1:00:00|True|
|1992-10-26 08:39:00.316686848+00:00|1992-10-26
08:39:00.316686+00:00|0:00:00|False|
|1993-10-26 08:39:00.316686848+00:00|1993-10-26
08:39:00.316686+00:00|0:00:00|False|
|1994-10-26 08:39:00.316686848+00:00|1994-10-26
08:39:00.316686+00:00|0:00:00|False|
|1995-10-26 08:39:00.316686848+00:00|1995-10-26
08:39:00.316686+00:00|0:00:00|False|
|1996-10-26 09:39:00.316686848+01:00|1996-10-26
09:39:00.316686+01:00|1:00:00|False|
|1997-10-26 08:39:00.316686848+00:00|1997-10-26
08:39:00.316686+00:00|0:00:00|False|
|1998-10-26 08:39:00.316686848+00:00|1998-10-26
08:39:00.316686+00:00|0:00:00|False|
|1999-10-26 09:39:00.316686848+01:00|1999-10-26
09:39:00.316686+01:00|1:00:00|False|
|2000-10-26 09:39:00.316686848+01:00|2000-10-26
09:39:00.316686+01:00|1:00:00|False|
|2001-10-26 09:39:00.316686848+01:00|2001-10-26
09:39:00.316686+01:00|1:00:00|False|
|2002-10-26 09:39:00.316686848+01:00|2002-10-26
09:39:00.316686+01:00|1:00:00|False|
|2003-10-26 08:39:00.316686848+00:00|2003-10-26
08:39:00.316686+00:00|0:00:00|False|
|2004-10-26 09:39:00.316686848+01:00|2004-10-26
09:39:00.316686+01:00|1:00:00|False|
|2005-10-26 09:39:00.316686848+01:00|2005-10-26
09:39:00.316686+01:00|1:00:00|False|
|2006-10-26 09:39:00.316686848+01:00|2006-10-26
09:39:00.316686+01:00|1:00:00|False|
|2007-10-26 09:39:00.316686848+01:00|2007-10-26
09:39:00.316686+01:00|1:00:00|False|
|2008-10-26 08:39:00.316686848+00:00|2008-10-26
08:39:00.316686+00:00|0:00:00|False|
|2009-10-26 08:39:00.316686848+00:00|2009-10-26
08:39:00.316686+00:00|0:00:00|False|
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]