Skip to content

Commit a48fa78

Browse files
authored
Merge pull request #841 from opsmill/pog-timestamp-argument
Fix invalid-argument-type violations
2 parents 7aeb880 + b417aaf commit a48fa78

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

infrahub_sdk/timestamp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ def _parse_string(cls, value: str) -> ZonedDateTime:
9292
params["hours"] = float(match.group(1))
9393

9494
if params:
95-
return ZonedDateTime.now("UTC").subtract(**params)
95+
return ZonedDateTime.now("UTC").subtract(
96+
seconds=params.get("seconds", 0.0),
97+
minutes=params.get("minutes", 0.0),
98+
hours=params.get("hours", 0.0),
99+
)
96100

97101
raise TimestampFormatError(f"Invalid time format for {value}")
98102

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,6 @@ include = ["infrahub_sdk/node/node.py"]
158158
[tool.ty.overrides.rules]
159159
invalid-argument-type = "ignore" # 9 violations - lines 776, 855, 859, 862
160160

161-
[[tool.ty.overrides]]
162-
include = ["infrahub_sdk/timestamp.py"]
163-
164-
[tool.ty.overrides.rules]
165-
invalid-argument-type = "ignore" # 6 violations at line 95 (multiple parameters)
166161

167162
[[tool.ty.overrides]]
168163
include = ["infrahub_sdk/ctl/config.py"]

0 commit comments

Comments
 (0)