From b417aafd42c9d45b05c67bcbf47821537cb7400a Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Thu, 19 Feb 2026 12:50:47 +0100 Subject: [PATCH] Fix invalid-argument-type violations --- infrahub_sdk/timestamp.py | 6 +++++- pyproject.toml | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/infrahub_sdk/timestamp.py b/infrahub_sdk/timestamp.py index 07de7b40..fd69122e 100644 --- a/infrahub_sdk/timestamp.py +++ b/infrahub_sdk/timestamp.py @@ -92,7 +92,11 @@ def _parse_string(cls, value: str) -> ZonedDateTime: params["hours"] = float(match.group(1)) if params: - return ZonedDateTime.now("UTC").subtract(**params) + return ZonedDateTime.now("UTC").subtract( + seconds=params.get("seconds", 0.0), + minutes=params.get("minutes", 0.0), + hours=params.get("hours", 0.0), + ) raise TimestampFormatError(f"Invalid time format for {value}") diff --git a/pyproject.toml b/pyproject.toml index 2aa9b28e..9cf63fde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -162,11 +162,6 @@ include = ["infrahub_sdk/node/node.py"] [tool.ty.overrides.rules] invalid-argument-type = "ignore" # 9 violations - lines 776, 855, 859, 862 -[[tool.ty.overrides]] -include = ["infrahub_sdk/timestamp.py"] - -[tool.ty.overrides.rules] -invalid-argument-type = "ignore" # 6 violations at line 95 (multiple parameters) [[tool.ty.overrides]] include = ["infrahub_sdk/ctl/config.py"]