Skip to content

API docs: fix type of Decimal Time properties #798

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

Merged
merged 2 commits into from
Sep 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions neo4j/time/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ def days_in_month(cls, year, month):

:param year: the year to look up
:type year: int
:param year: the month to look up
:param month: the month to look up
:type year: int

:rtype: int
Expand Down Expand Up @@ -1738,7 +1738,11 @@ def second(self):
This contains seconds and nanoseconds of the time.
`int(:attr:`.seconds`)` will yield the seconds without nanoseconds.

:type: float
:type: decimal.Decimal

.. versionchanged:: 4.4
The property's type changed from :class:`float` to
:class:`decimal.Decimal` to mitigate rounding issues.
"""
# TODO 5.0: return plain self.__second
with _decimal_context(prec=11):
Expand All @@ -1762,7 +1766,12 @@ def hour_minute_second(self):
Will be removed in 5.0.
Use :attr:`.hour_minute_second_nanosecond` instead.

:type: (int, int, float)"""
:type: (int, int, decimal.Decimal)

.. versionchanged:: 4.4
Last element of the property changed from :class:`float` to
:class:`decimal.Decimal` to mitigate rounding issues.
"""
return self.__hour, self.__minute, self.second

@property
Expand Down