[SYNPY-1770] fix variable mutation in get_conditional_properties #1319
+35
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
There's an issue when generating data model using
display label(see Jess's comment here)Take a look at the code here:
When there are multiple watched properties for a valid value, the value loop variable gets overwritten with its display name on the first iteration of the inner loop. On subsequent iterations, self.dmge.get_nodes_display_names([value]) fails with a KeyError because it tries to look up the display name (e.g., "synovial tissue") in the graph, but graph nodes are keyed by class labels (e.g., "Synovialtissue"), not display names.
Solution:
Ensure
valuedoesn't get overwritten.Test:
The following works: