codephage2020 commented on issue #9490: URL: https://github.com/apache/arrow-rs/issues/9490#issuecomment-3976677823
Your idea mostly makes sense to me. The design of this API originates from (here)[https://github.com/apache/arrow-rs/issues/9337#issuecomment-3842152008]. If left to the user's discretion, the API would indeed be more concise and orthogonal. It would look like this: ```rust pub trait ArrowTimestampType: ArrowTemporalType<Native = i64> { const UNIT: TimeUnit; /// Create from a naive local time (interpreted as UTC) fn from_naive_datetime(naive: NaiveDateTime) -> Option<i64> { Self::from_datetime(naive.and_utc()) } /// Create from a DateTime with timezone fn from_datetime<Tz: TimeZone>(datetime: DateTime<Tz>) -> Option<i64>; // Remove from_naive_datetime(naive, Option<&Tz>) } ``` What are your thoughts? @alamb @sdf-jkl -- 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]
