Skip to content

Commit

Permalink
lib360dataquality: Add some plausible data looking at for missing data
Browse files Browse the repository at this point in the history
When we don't have a location to point to due to flattening the file
without those data columns we have to point the use to the nearest
logical place.
  • Loading branch information
michaelwood committed Feb 10, 2025
1 parent 9290af7 commit 74e640e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions cove/cove_360/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@
"percentage": 1/TOTAL_GRANTS,
"type": "BeneficiaryLocationNameButNoCode"
},
["grants/0/beneficiaryLocation/0/geoCode"],
["grants/0/beneficiaryLocation/0/name"],
[] # FIXME No spreadsheet location?
),
(
Expand All @@ -887,8 +887,10 @@
"percentage": 1/TOTAL_GRANTS,
"type": "BeneficiaryButNotRecipientGeoData"
},
["grants/2/recipientOrganization/0/location"],
[]
["grants/2/recipientOrganization/0/id"],
[
{"header": "Recipient Org:Identifier", "letter": "J", "row_number": 4, "sheet": "grants"},
]
), # FIXME No spreadsheet location?
(
{
Expand Down
4 changes: 2 additions & 2 deletions lib360dataquality/cove/threesixtygiving.py
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,7 @@ def process(self, grant, path_prefix):
self.failed = True
self.count += 1
self.json_locations.append(
path_prefix + "/recipientOrganization/0/location"
path_prefix + "/recipientOrganization/0/id"
)

self.heading = mark_safe(self.format_heading_count(self.check_text["heading"]))
Expand Down Expand Up @@ -1942,7 +1942,7 @@ def process(self, grant, path_prefix):
self.failed = True
self.count += 1
self.json_locations.append(
path_prefix + "/beneficiaryLocation/{}/geoCode".format(num)
path_prefix + "/beneficiaryLocation/{}/name".format(num)
)

self.heading = mark_safe(self.format_heading_count(self.check_text["heading"]))
Expand Down

0 comments on commit 74e640e

Please sign in to comment.