You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pearu (via GitHub)" <gi...@apache.org> on 2026/10/19 19:15:44 UTC

[PR] GH-54651: [C++][Python] Use timestamp_parsers as a fallback for CSV time columns [arrow]

pearu opened a new pull request, #54662:
URL: https://github.com/apache/arrow/pull/54662

   ### Rationale for this change
   
   CSV columns typed as `time32` or `time64` are parsed only from the ISO-8601 format, and `ConvertOptions::timestamp_parsers` applies only to timestamp columns, so other time formats need reading as a timestamp and a cast.
   
   ### What changes are included in this PR?
   
   - Time columns try `timestamp_parsers` after the ISO-8601 parser fails, and take the time of day of the parsed timestamp, as a cast from timestamp to time does. This also works for dates outside the range of the time unit's timestamps (e.g. year 9999 with nanoseconds).
   - With the ISO-8601 parser in `timestamp_parsers`, fractional seconds are kept, and the value is rejected if the time unit cannot represent them.
   - `strptime` parsers without a time directive are skipped, and ISO-8601 values without a time of day are rejected, so that a date does not become midnight.
   - Type inference of time columns is unchanged and uses ISO-8601 only.
   
   This PR is the time part of #50146. It builds on #54661 (date columns) and its dependencies #54656, #54657 and #54659, which must land first. Only the last commit is new here.
   
   ### Are these changes tested?
   
   Yes, `Time32Conversion.UserDefinedParsers` and `Time64Conversion.UserDefinedParsers` in C++, and `test_times_with_timestamp_parsers` in Python.
   
   ### Are there any user-facing changes?
   
   Yes, `timestamp_parsers` now also applies to `time32`/`time64` columns given in `column_types`. This is documented in the C++ CSV docs and the `ConvertOptions` docstring.
   
   ### AI usage disclosure
   
   Developed with AI assistance (Claude Code): the implementation, tests, documentation and this description were AI-generated under my direction and reviewed line by line by me. I own and can debug these changes. No copyrighted material is included.
   
   * GitHub Issue: #54651
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-54651: [C++][Python] Use timestamp_parsers as a fallback for CSV time columns [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #54662: GH-54651: [C++][Python] Use timestamp_parsers as a fallback for CSV time columns
URL: https://github.com/apache/arrow/pull/54662


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-54651: [C++][Python] Use timestamp_parsers as a fallback for CSV time columns [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #54662:
URL: https://github.com/apache/arrow/pull/54662#issuecomment-6275273621

   <!--
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
   -->
   
   Thanks for opening a pull request!
   
   **This pull request has been automatically closed because you currently have 4 open pull requests, which is more than the limit of 3.**
   
   Due to the increase in pull requests opened by AI bots, and in order to keep the review queue manageable, Apache Arrow limits contributors without repository access to at most 3 concurrently open pull requests. This helps make sure each pull request gets the attention it needs and that work in progress does not go stale.
   
   Once one of [your other open pull requests](https://github.com/apache/arrow/pulls/pearu) has been merged or closed, you are welcome to reopen this one.
   
   See also:
   
     * [Contribution Guidelines - Limit on concurrent pull requests](https://arrow.apache.org/docs/dev/developers/bug_reports.html#pr-limit)
     * [Contribution Guidelines - Contributing Overview](https://arrow.apache.org/docs/developers/overview.html)
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-54651: [C++][Python] Use timestamp_parsers as a fallback for CSV time columns [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #54662:
URL: https://github.com/apache/arrow/pull/54662#issuecomment-6275263093

   :warning: GitHub issue #54651 **has been automatically assigned in GitHub** to PR creator.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org