Skip to content

Commit fe115e1

Browse files
committed
Fix new pylint warnings.
They are due to the fact that types for arrow are now present. We now make the int -> Decimal conversion in parse_datetime_duration() explicitly.
1 parent e3f435e commit fe115e1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/isoduration/parser/parsing.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections import OrderedDict
22
from decimal import Decimal, InvalidOperation
33

4-
import arrow # type: ignore
4+
import arrow
55

66
from isoduration.parser.exceptions import (
77
IncorrectDesignator,
@@ -28,14 +28,14 @@ def parse_datetime_duration(duration_str: str, sign: int) -> Duration:
2828

2929
return Duration(
3030
DateDuration(
31-
years=sign * duration.year,
32-
months=sign * duration.month,
33-
days=sign * duration.day,
31+
years=Decimal(sign * duration.year),
32+
months=Decimal(sign * duration.month),
33+
days=Decimal(sign * duration.day),
3434
),
3535
TimeDuration(
36-
hours=sign * duration.hour,
37-
minutes=sign * duration.minute,
38-
seconds=sign * duration.second,
36+
hours=Decimal(sign * duration.hour),
37+
minutes=Decimal(sign * duration.minute),
38+
seconds=Decimal(sign * duration.second),
3939
),
4040
)
4141

0 commit comments

Comments
 (0)