brunal commented on issue #9490:
URL: https://github.com/apache/arrow-rs/issues/9490#issuecomment-3977004005

   I did not realize `make_value` was simply doing `and_utc`. Looking at the 
spec ([C++ 
DataType](https://arrow.apache.org/docs/cpp/api/datatype.html#_CPPv4N5arrow13TimestampTypeE),
 [Rust Arrow 
IPC](https://arrow.apache.org/rust/arrow_ipc/gen/Schema/struct.Timestamp.html)),
 this all makes sense. Keeping `from_naive_datetime(naive_dt)` is sensible, 
even if the user could call `and_utc()` themselves, as that matches the 
semantics of a timestamp array with unset/empty timezone.
   
   One thing that bothers me is that there's no link between 
`from_datetime`/`from_naive_datetime` usage & the timestamp set for the array 
in the schema. i.e. one can have a `DataType::Timestamp(TimeUnit::Millisecond, 
None)` field and build the data with `from_datetime`, losing the timezone 
guarantee, or (worse) have a `DataType::Timestamp(TimeUnit::Millisecond, 
Some("+08:00"))` field and build the data with `from_naive_datetime`. They 
provided something naive, but they end up with a timezone contract. 
Unfortunately, I don't think that can trivially be solved.
   
   Sorry for the rant. The only take-away is that I  confirm I believe the `tz` 
arg from `from_naive_datetime(dt, tz)` to be a mistake.


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