Skip to content

Latest commit

 

History

History
14 lines (8 loc) · 611 Bytes

PROD.md

File metadata and controls

14 lines (8 loc) · 611 Bytes

The following code is used to find and display instances where there are multiple ObservationUpdated entries with the same published date and observation_id, but only when the published time is not exactly midnight. This could be useful for identifying potential data inconsistencies or duplicate entries in the database.

k = ObservationUpdated.objects.values('published', 'observation_id').annotate(cnt=Count('published')).order_by()
t = list(filter(lambda x: x['cnt'] > 1, k))
u = list(filter(lambda x: x['published'].hour != 0 and x['published'].minute != 0, t))
for i in u:
    print(i)