arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.71k stars 673 forks source link

Add normalize_spaces flag to arrow.get #813

Closed meddir closed 4 years ago

meddir commented 4 years ago

Pull Request Checklist

Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:

If you have any questions about your code changes or any of the points above, please submit your questions along with the pull request and we will try our best to help!

Description of Changes

Added normalize_spaces flag to factory.get(), parser.parse(), and parser.parse_iso(). This would remove redundant whitespace from the datetime_string so that the parsing would behave as expected.

Closes: #421

codecov-commenter commented 4 years ago

Codecov Report

Merging #813 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #813   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines         1771      1776    +5     
  Branches       304       306    +2     
=========================================
+ Hits          1771      1776    +5     
Impacted Files Coverage Δ
arrow/factory.py 100.00% <100.00%> (ø)
arrow/parser.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2cfb2b0...34f2928. Read the comment docs.

systemcatch commented 4 years ago

Hey @meddir thanks for the PR, we're all really busy right now with work/life stuff but don't worry we haven't forgotten this.

jadchaar commented 4 years ago

@meddir one thing that I would like to see added is documentation to alert users to this new flag: https://github.com/crsmithdev/arrow/blob/master/docs/index.rst.

jadchaar commented 4 years ago

@systemcatch I have addressed your feedback and added documentation. Mind taking another look before we merge this in?