Skip to content

Commit 10773ba

Browse files
fix: iac diff scan typing
1 parent 4f15dd4 commit 10773ba

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pygitguardian/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from .config import DEFAULT_API_VERSION, DEFAULT_BASE_URI, DEFAULT_TIMEOUT
1515
from .iac_models import (
1616
IaCDiffScanResult,
17-
IaCDiffScanResultSchema,
1817
IaCScanParameters,
1918
IaCScanParametersSchema,
2019
IaCScanResult,
@@ -533,7 +532,7 @@ def iac_diff_scan(
533532
result.status_code = 504
534533
else:
535534
if is_ok(resp):
536-
result = IaCDiffScanResultSchema.from_dict(resp.json()) # type: ignore
535+
result = IaCDiffScanResult.from_dict(resp.json())
537536
else:
538537
result = load_detail(resp)
539538

pygitguardian/iac_models.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class IaCDiffScanEntities(Base):
7373

7474

7575
@dataclass
76-
class IaCDiffScanResult(Base):
76+
class IaCDiffScanResult(Base, FromDictMixin):
7777
id: str = ""
7878
type: str = ""
7979
iac_engine_version: str = ""
@@ -82,6 +82,7 @@ class IaCDiffScanResult(Base):
8282
)
8383

8484

85-
IaCDiffScanResultSchema = marshmallow_dataclass.class_schema(
86-
IaCDiffScanResult, BaseSchema
85+
IaCDiffScanResultSchema = cast(
86+
Type[BaseSchema], marshmallow_dataclass.class_schema(IaCDiffScanResult, BaseSchema)
8787
)
88+
IaCDiffScanResult.SCHEMA = IaCDiffScanResultSchema()

0 commit comments

Comments
 (0)