Skip to content

Commit 2296bd1

Browse files
committed
Reenable convert query test for transforms and fix code
1 parent 21d3c54 commit 2296bd1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

backend/infrahub/proposed_change/tasks.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,9 @@ async def refresh_artifacts(
12221222
file_path {
12231223
value
12241224
}
1225+
convert_query_response {
1226+
value
1227+
}
12251228
}
12261229
repository {
12271230
node {
@@ -1429,6 +1432,9 @@ def _parse_artifact_definitions(definitions: list[dict]) -> list[ProposedChangeA
14291432
elif artifact_definition.transform_kind == InfrahubKind.TRANSFORMPYTHON:
14301433
artifact_definition.class_name = definition["node"]["transformation"]["node"]["class_name"]["value"]
14311434
artifact_definition.file_path = definition["node"]["transformation"]["node"]["file_path"]["value"]
1435+
artifact_definition.convert_query_response = definition["node"]["transformation"]["node"][
1436+
"convert_query_response"
1437+
]["value"]
14321438

14331439
parsed.append(artifact_definition)
14341440

backend/tests/fixtures/repos/car-dealership/initial__main/transforms/converted_person_with_cars.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ class ConvertedPersonWith(InfrahubTransform):
99
async def transform(self, data: dict[str, Any]) -> dict[str, Any]:
1010
node_id = data["TestingPerson"]["edges"][0]["node"]["id"]
1111

12-
person = self.store.get(key=node_id, kind="TestingPerson", raise_when_missing=False)
13-
if not person:
14-
person = await self.client.get(kind="TestingPerson", id=node_id)
12+
person = self.store.get(key=node_id, kind="TestingPerson")
1513

1614
return {"name": person.name.value, "age": person.age.value}

0 commit comments

Comments
 (0)