Skip to content

Commit

Permalink
Fix TAHMO ingestor for empty value (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
meomancer authored Jul 3, 2024
1 parent a548ab9 commit d461836
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions django_project/gap/ingestor/tahmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ def _run(self, dir_path):
unit = attr_var.unit
except KeyError:
unit = None

# Skip empty one
if value == '':
continue

measure, _ = Measurement.objects.get_or_create(
station=station,
attribute=attribute,
Expand Down
Binary file modified django_project/gap/tests/ingestor/data/TAHMO test stations.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion django_project/gap/tests/ingestor/test_tahmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ def test_correct(self):
).measurement_set.all()
for attribute in Attribute.objects.all():
self.assertEqual(
measurements.filter(attribute=attribute).count(), 24
measurements.filter(attribute=attribute).count(), 23
)

0 comments on commit d461836

Please sign in to comment.