Skip to content

Commit 4224b14

Browse files
Adjust API v2/v1 comparison function (#2359)
* Fix Allow for `None={}` when comparing APIv1 and v2 #2358 * Versioning
1 parent 6d7335b commit 4224b14

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: patch
2+
changes:
3+
fixed:
4+
- Allowed for None/{} comparisons (v1/v2).

policyengine_api/jobs/calculate_economy_simulation_job.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ def _compute_cliff_impacts(self, simulation: Microsimulation) -> Dict:
464464

465465

466466
def is_similar(x, y, parent_name: str = "") -> bool:
467+
if x is None or x == {}:
468+
if y is None or y == {}:
469+
return True
467470
# Handle None values
468471
if x is None or y is None:
469472
equal = x is y

0 commit comments

Comments
 (0)