arrow-py / arrow

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

Fix arrow.get functionality when weekday is parsed alone #823

Closed jadchaar closed 4 years ago

jadchaar 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

Closes: https://github.com/crsmithdev/arrow/issues/446

Replaces https://github.com/crsmithdev/arrow/pull/820 due to GitHub glitch.

codecov-commenter commented 4 years ago

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #823   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         1757      1776   +19     
  Branches       300       304    +4     
=========================================
+ Hits          1757      1776   +19     
Impacted Files Coverage Δ
arrow/parser.py 100.00% <100.00%> (ø)
arrow/util.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 e5a8fa6...d855095. Read the comment docs.

systemcatch commented 4 years ago

Hey Jad, do we want to create regression test based on the bug in #446 ?

assert arrow.get("Tuesday", "dddd").format("dddd") == 'Monday'

jadchaar commented 4 years ago

@systemcatch I was thinking of creating one, but I did not know where to put it. Do you think it relates more to parsing than formatting?

systemcatch commented 4 years ago

I think where you've put them is fine, later this evening I can check then approve the PR.