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"]