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

Migration guide for v1.0.0 #832

Open
jadchaar opened this issue Jul 25, 2020 · 1 comment
Open

Migration guide for v1.0.0 #832

jadchaar opened this issue Jul 25, 2020 · 1 comment
Milestone

Comments

@jadchaar
Copy link
Member

jadchaar commented Jul 25, 2020

The v1.0.0 release of Arrow contains breaking changes, this migration guide outlines the changed APIs and functionality. Please visit #923 to discuss the changes and ask any questions.

  1. Python 2.7 and 3.5 are no longer supported.

  2. The .timestamp property has been removed to improve compatibility with datetime. Use .int_timestamp for the same results.

>>> arrow.utcnow().int_timestamp
1608640233
  1. Arrow has a new method timestamp() which wraps the datetime method of the same name.
>>> arrow.utcnow().timestamp()
1608641039.22176
  1. It's no longer possible to set the tzinfo property directly, instead use replace().
>>> dt=arrow.utcnow()
>>> dt.tzinfo=tz.gettz("US/Pacific")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: can't set attribute
>>> dt.replace(tzinfo=tz.gettz("US/Pacific"))
<Arrow [2020-12-22T16:03:29.630250-08:00]>
  1. arrow.get(None) now returns an error rather than current UTC.
>>> arrow.get(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/chris/arrow/arrow/api.py", line 80, in get
    return _factory.get(*args, **kwargs)
  File "/home/chris/arrow/arrow/factory.py", line 228, in get
    raise TypeError("Cannot parse argument of type None.")
TypeError: Cannot parse argument of type None.
  1. The "X" token now returns a float rather than an int.
>>> arrow.utcnow().format("X")
'1614719652.85991'
@jadchaar jadchaar added this to the v1.0.0 milestone Jul 25, 2020
@jadchaar jadchaar changed the title Migration Guide for v1.0.0 Migration guide for v1.0.0 Jul 26, 2020
@systemcatch systemcatch pinned this issue Nov 24, 2020
@arrow-py arrow-py locked and limited conversation to collaborators Feb 23, 2021
@arrow-py arrow-py unlocked this conversation Feb 26, 2021
kernicPanel added a commit to openfun/richie that referenced this issue Mar 1, 2021
Arrow version 1.0 introduces some breaking changes arrow-py/arrow#832
timestamp property has been replaced by int_timestamp
kernicPanel added a commit to openfun/richie that referenced this issue Mar 1, 2021
Arrow version 1.0 introduces some breaking changes arrow-py/arrow#832
timestamp property has been replaced by int_timestamp
kernicPanel added a commit to openfun/richie that referenced this issue Mar 1, 2021
Arrow version 1.0 introduces some breaking changes
arrow-py/arrow#832
timestamp property has been replaced by int_timestamp
kernicPanel added a commit to openfun/richie that referenced this issue Mar 1, 2021
Arrow version 1.0 introduces some breaking changes
arrow-py/arrow#832
timestamp property has been replaced by int_timestamp
sd2e-jenkins pushed a commit to SD2E/python-datacatalog that referenced this issue Mar 2, 2021
@jadchaar jadchaar unpinned this issue Apr 28, 2021
@jadchaar jadchaar pinned this issue Apr 29, 2021
@Kaju-Bubanja
Copy link

Also microseconds was renamed to microsecond in the arrow_object.replace() function. Probably also in other places

pypingou pushed a commit to Pagure/pagure that referenced this issue Feb 13, 2023
The missing property in newer arrow versions, caused that variables only contained references like '<bound method Arrow.timestamp of <Arrow [2023-01-15T02:16:14.627656+00:00]>>' instead the actual timestamp values.
Tests in 'tests/test_pagure_flask_dump_load_ticket.py' failed with 'ValueError: could not convert string to float'.

References
https://arrow.readthedocs.io/en/latest/releases.html
Quote: 'Calls to the timestamp property now emit a DeprecationWarning.'

arrow-py/arrow#832
Quote: 'The .timestamp property has been removed to improve compatibility with datetime. Use .int_timestamp for the same results.'

libgit2/pygit2#1122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants