Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow x token to be used in formatting #737

Closed
wants to merge 15 commits into from

Conversation

alstomli
Copy link

Pull Request Checklist

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

  • 🧪 Added tests for changed code.
  • 🛠️ All tests pass when run locally (run tox or make test to find out!).
  • 📚 Updated documentation for changed code.
  • ⏩ Code is up-to-date with the master branch.

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

@codecov-io
Copy link

codecov-io commented Dec 14, 2019

Codecov Report

Merging #737 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #737   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines        1678   1682    +4     
  Branches      283    284    +1     
=====================================
+ Hits         1678   1682    +4
Impacted Files Coverage Δ
arrow/formatter.py 100% <100%> (ø) ⬆️
arrow/locales.py 100% <0%> (ø) ⬆️

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 5395fbb...a2f168e. Read the comment docs.

@jadchaar jadchaar changed the title add new token x Allow x token to be used in formatting Dec 14, 2019
@systemcatch
Copy link
Collaborator

Hey @alstomli I've been checking out your branch and noticed that this is occurring.

(arrow) chris@ThinkPad:~/arrow$ python
Python 3.7.4 (default, Sep 19 2019, 11:01:37) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
>>> arw=arrow.utcnow()
>>> arw
<Arrow [2019-12-22T19:44:08.492814+00:00]>
>>> arw.format("x")
'x'

@alstomli
Copy link
Author

I have just tested the program on my machine it seems there is nothing wrong
`>>> import arrow

arrow.utcnow().format("x")
'1577074797676671'
arw = arrow.utcnow()
arw.format("x")
'1577074859157219'
arw
<Arrow [2019-12-23T04:20:59.157219+00:00]>`

@alstomli
Copy link
Author

Hi @systemcatch if we need to add new "x" format I think we need to rewrite
r"(\[(?:(?=(?P<literal>[^]]))(?P=literal))*\]|YYY?Y?|MM?M?M?|Do|DD?D?D?|d?dd?d?|HH?|hh?|mm?|ss?|SS?S?S?S?S?|ZZ?Z?|a|A|X)" into r"(\[(?:(?=(?P<literal>[^]]))(?P=literal))*\]|YYY?Y?|MM?M?M?|Do|DD?D?D?|d?dd?d?|HH?|hh?|mm?|ss?|SS?S?S?S?S?|ZZ?Z?|a|A|X|x)" so the program can detect the new token, however, when I submitted this change it says it is an conflit, is there any way to solve this?

@jadchaar
Copy link
Member

jadchaar commented Jan 1, 2020

Hey, we are going to close this for now since we are pushing these changes to when we drop Python 2.7 support because this will allow us to introduce some breaking changes to the existing API.

@jadchaar jadchaar closed this Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants