Skip to content

Commit 4d1e9dd

Browse files
authored
fix: Bug in pdl_schema_error_analyzer that raises exception during analysis (#851)
When the PDL doesn't match the schema, the error analysis fails as it attempts to retrieve the field names without verifying that `"properties"` key exists in `ref_type`. This change returns an empty `dict` if `properties` key doesn't exist in `ref_type` to allow the error analysis to complete successfully. Signed-off-by: Abi Ullattil <[email protected]>
1 parent a19aeab commit 4d1e9dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pdl/pdl_schema_error_analyzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get_non_null_type(schema):
4848

4949

5050
def match(ref_type, data):
51-
all_fields = ref_type["properties"].keys()
51+
all_fields = ref_type.get("properties", {}).keys()
5252
intersection = list(set(data.keys()) & set(all_fields))
5353
return len(intersection)
5454

0 commit comments

Comments
 (0)