lalithadevi commited on
Commit
761214c
1 Parent(s): 60be9e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -53,11 +53,11 @@ def update_news():
53
  if news_df is None:
54
  raise Exception('Could not generate category predictions. Aborting the database insertion. No new articles are inserted into the collection.')
55
 
56
- old_news_count = 0 if old_news is None else len(old_news)
57
- new_news_count = 0 if news_df is None else len(news_df)
58
- logger.warning(f'Old News count: {old_news_count}\nNew News count: {new_news_count}')
59
- if new_news_count < old_news_count:
60
- raise Exception('New news count < Old news count. Aborting the database insertion. No new articles are inserted into the collection.')
61
 
62
  if is_db_updation_required:
63
  news_json = [*json.loads(news_df.reset_index(drop=True).to_json(orient="index")).values()]
 
53
  if news_df is None:
54
  raise Exception('Could not generate category predictions. Aborting the database insertion. No new articles are inserted into the collection.')
55
 
56
+ # old_news_count = 0 if old_news is None else len(old_news)
57
+ # new_news_count = 0 if news_df is None else len(news_df)
58
+ # logger.warning(f'Old News count: {old_news_count}\nNew News count: {new_news_count}')
59
+ # if new_news_count < old_news_count:
60
+ # raise Exception('New news count < Old news count. Aborting the database insertion. No new articles are inserted into the collection.')
61
 
62
  if is_db_updation_required:
63
  news_json = [*json.loads(news_df.reset_index(drop=True).to_json(orient="index")).values()]