Skip to content

Commit 39661f1

Browse files
authored
Merge pull request #7558 from opsmill/ajtm-11032025-maybe-fix-unit-test
hopefully fix flaky unit test
2 parents bf00998 + c9e84e6 commit 39661f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backend/infrahub/core/migrations/graph/m041_profile_attrs_in_db.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: dict[str, Any]) -> No
3636
query = """
3737
MATCH (profile:CoreProfile)-[:HAS_ATTRIBUTE]->(attr:Attribute)-[e:HAS_VALUE]->(:AttributeValue)
3838
WHERE e.branch = $branch
39+
WITH DISTINCT profile.uuid AS profile_uuid
3940
"""
4041
self.add_to_query(query)
41-
self.return_labels = ["profile.uuid AS profile_uuid"]
42+
self.return_labels = ["profile_uuid"]
4243

4344
def get_profile_ids(self) -> list[str]:
4445
"""Get list of updated profile UUIDs"""
@@ -101,7 +102,7 @@ async def _do_execute_for_branch(self, db: InfrahubDatabase, branch: Branch) ->
101102
result = MigrationResult()
102103
await get_or_load_schema_branch(db=db, branch=branch)
103104

104-
console.print(f"Gathering profiles for each branch {branch.name}...", end="")
105+
console.print(f"Gathering profiles for branch {branch.name}...", end="")
105106
get_updated_profiles_for_branch_query = await GetUpdatedProfilesForBranchQuery.init(db=db, branch=branch)
106107
await get_updated_profiles_for_branch_query.execute(db=db)
107108
profile_ids = get_updated_profiles_for_branch_query.get_profile_ids()

0 commit comments

Comments
 (0)