richarddmorey commented on issue #49836:
URL: https://github.com/apache/arrow/issues/49836#issuecomment-4390331414

   Adding a +1 to this; was about to make a bug report but noticed that this 
had already been raised. Thanks @dragosmg.
   
   Oddly, I have a slightly different result; I am getting dates far in the 
past for Inf as well as -Inf, when using {lubridate}:
   
   ``` r
   library(dplyr)
   #> Warning: package 'dplyr' was built under R version 4.5.3
   #> 
   #> Attaching package: 'dplyr'
   #> The following objects are masked from 'package:stats':
   #> 
   #>     filter, lag
   #> The following objects are masked from 'package:base':
   #> 
   #>     intersect, setdiff, setequal, union
   library(lubridate)
   #> Warning: package 'lubridate' was built under R version 4.5.3
   #> 
   #> Attaching package: 'lubridate'
   #> The following objects are masked from 'package:base':
   #> 
   #>     date, intersect, setdiff, union
   
   tibble(
     date = c(
       ymd("2008/01/01"),
       as_date(-Inf),
       as_date(Inf)
     )
   ) -> x
   
   # Seems to act reasonably
   x$date > ymd("2007/01/01")
   #> [1]  TRUE FALSE  TRUE
   is.infinite(x$date)
   #> [1] FALSE  TRUE  TRUE
   
   tf = tempfile(fileext = ".feather")
   arrow::write_feather(x = x, sink = tf)
   x_arrow = arrow::read_feather(tf)
   
   x
   #> # A tibble: 3 × 1
   #>   date      
   #>   <date>    
   #> 1 2008-01-01
   #> 2 -Inf      
   #> 3 Inf
   
   x_arrow
   #> # A tibble: 3 × 1
   #>   date          
   #>   <date>        
   #> 1 2008-01-01    
   #> 2 -5877641-06-23
   #> 3 -5877641-06-23
   
   # This is no longer correct
   x_arrow$date > ymd("2007/01/01")
   #> [1]  TRUE FALSE FALSE
   
   xfun::session_info()
   #> R version 4.5.1 (2025-06-13 ucrt)
   #> Platform: x86_64-w64-mingw32/x64
   #> Running under: Windows 11 x64 (build 26200)
   #> 
   #> Locale:
   #>   LC_COLLATE=English_United States.utf8 
   #>   LC_CTYPE=English_United States.utf8   
   #>   LC_MONETARY=English_United States.utf8
   #>   LC_NUMERIC=C                          
   #>   LC_TIME=English_United States.utf8    
   #> 
   #> Package version:
   #>   arrow_24.0.0      assertthat_0.2.1  base64enc_0.1.6   bit_4.6.0        
   #>   bit64_4.6.0-1     bslib_0.10.0      cachem_1.1.0      callr_3.7.6      
   #>   cli_3.6.5         clipr_0.8.0       compiler_4.5.1    cpp11_0.5.3      
   #>   digest_0.6.39     dplyr_1.2.1       evaluate_1.0.5    fastmap_1.2.0    
   #>   fontawesome_0.5.3 fs_1.6.7          generics_0.1.4    glue_1.8.0       
   #>   graphics_4.5.1    grDevices_4.5.1   highr_0.12        htmltools_0.5.9  
   #>   jquerylib_0.1.4   jsonlite_2.0.0    knitr_1.51        lifecycle_1.0.5  
   #>   lubridate_1.9.5   magrittr_2.0.4    memoise_2.0.1     methods_4.5.1    
   #>   mime_0.13         otel_0.2.0        pillar_1.11.1     pkgconfig_2.0.3  
   #>   processx_3.8.6    ps_1.9.1          purrr_1.1.0       R6_2.6.1         
   #>   rappdirs_0.3.4    reprex_2.1.1      rlang_1.1.7       rmarkdown_2.30   
   #>   rstudioapi_0.18.0 sass_0.4.10       stats_4.5.1       tibble_3.3.0     
   #>   tidyselect_1.2.1  timechange_0.4.0  tinytex_0.58      tools_4.5.1      
   #>   tzdb_0.5.0        utf8_1.2.6        utils_4.5.1       vctrs_0.7.1      
   #>   withr_3.0.2       xfun_0.56         yaml_2.3.12
   ```
   
   
   
   ```


-- 
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]

Reply via email to