IATI/IATI-Stats

location/point/pos may exist but be empty

Closed this issue · 0 comments

Files containing data such as this (example file):

<location>
  <point srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
    <pos/>
  </point>
</location>

Cause issues with the stats code. The end result is that the comprehensiveness_with_validation.json returns an empty dictionary - i.e. {}.

Stack trace:

-> bools.update({
(Pdb) c
Traceback (most recent call last):
  File "/Users/dalepotter/Documents/IATI-Stats/statsrunner/loop.py", line 18, in call_stats
    this_out[name] = function()
  File "/Users/dalepotter/Documents/IATI-Stats/stats/common/decorators.py", line 43, in wrapper
    out = f(self, *args, **kwargs)
  File "/Users/dalepotter/Documents/IATI-Stats/stats/dashboard.py", line 1140, in comprehensiveness_with_validation
    ) else 0) for k,v in self._comprehensiveness_with_validation_bools().items() }
  File "/Users/dalepotter/Documents/IATI-Stats/stats/dashboard.py", line 1056, in _comprehensiveness_with_validation_bools
    bools.update({
  File "/Users/dalepotter/Documents/IATI-Stats/stats/dashboard.py", line 48, in all_and_not_empty
    bool_list = list(bool_iterable)
  File "/Users/dalepotter/Documents/IATI-Stats/stats/dashboard.py", line 1102, in <genexpr>
    valid_coords(x.text) for x in bools['location_point_pos']),
  File "/Users/dalepotter/Documents/IATI-Stats/stats/dashboard.py", line 246, in valid_coords
    coords = x.split(' ')
AttributeError: 'NoneType' object has no attribute 'split'