Skip to content

Commit

Permalink
Unbreak Twitter error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Jul 15, 2024
1 parent e9b5232 commit 04acc06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datasources/twitterv2/search_twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def get_items(self, query):
self.dataset.log('Missing objects collected: ' + ', '.join(['%s: %s' % (k, len(v)) for k, v in missing_objects.items()]))
if num_missing_objects > 50:
# Large amount of missing objects; possible error with Twitter API
self.flawless = False
self.import_issues = False
error_report.append('%i missing objects received following tweet number %i. Possible issue with Twitter API.' % (num_missing_objects, tweets))
error_report.append('Missing objects collected: ' + ', '.join(['%s: %s' % (k, len(v)) for k, v in missing_objects.items()]))

Expand Down Expand Up @@ -333,7 +333,7 @@ def get_items(self, query):
else:
break

if not self.flawless:
if not self.import_issues:
self.dataset.log('Error Report:\n' + '\n'.join(error_report))
self.dataset.update_status("Completed with errors; Check log for Error Report.", is_final=True)

Expand Down

0 comments on commit 04acc06

Please sign in to comment.