arrow-py / arrow

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

Use datetime.strptime tokens internally for parsing ISO 8601 week dates #889

Closed yiransii closed 3 years ago

yiransii commented 3 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

Use datetime.strptime() tokens internally for parsing ISO 8601 week dates

Questions:

1) tests My code has passed python3.7, 3.8, and 3.9 tests. How should I deal with the pypy3 issue and the python3.6 issue properly?

ERROR:   pypy3: could not install deps [-rrequirements.txt]; v = InvocationError('/Users/yiransi/Documents/opensource/arrow/.tox/pypy3/bin/python -m pip install -rrequirements.txt', 1)
SKIPPED:  py36: InterpreterNotFound: python3.6
  py37: commands succeeded
  py38: commands succeeded
  py39: commands succeeded

2) linting checks Should I remove those test cases if the linting checks are only failing with the following message?

- hook id: flake8
- exit code: 1

tests/test_arrow.py:341:13: B015 Pointless comparison. This comparison does nothing but wastes CPU instructions. Remove it.
tests/test_arrow.py:349:13: B015 Pointless comparison. This comparison does nothing but wastes CPU instructions. Remove it.
tests/test_arrow.py:362:13: B015 Pointless comparison. This comparison does nothing but wastes CPU instructions. Remove it.
tests/test_arrow.py:370:13: B015 Pointless comparison. This comparison does nothing but wastes CPU instructions. Remove it.

Issue

Closes: #857

codecov[bot] commented 3 years ago

Codecov Report

Merging #889 (4c8a236) into master (1278a21) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #889   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines         1797      1798    +1     
  Branches       313       313           
=========================================
+ Hits          1797      1798    +1     
Impacted Files Coverage Δ
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 1278a21...4c8a236. Read the comment docs.