File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
backend-python/src/media_impact_monitor/data_loaders/news_online Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -41,22 +41,18 @@ def get_mediacloud_counts(
4141 if collection_ids
4242 else None
4343 )
44- stories = _story_count_over_time (
44+ counts = _story_count_over_time (
4545 query = query ,
4646 start_date = start_date ,
4747 end_date = end_date ,
4848 collection_ids = collection_ids ,
4949 platform = platform ,
5050 )
51- if stories is None :
51+ if counts is None :
5252 return None , []
53- stories ["publish_date" ] = pd .to_datetime (stories ["publish_date" ])
54- counts = stories .resample ("D" , on = "publish_date" ).size ()
55- counts = counts .reindex (pd .date_range (start_date , end_date ), fill_value = 0 )
56- counts = counts .rename ("count" )
53+ counts = pd .DataFrame (counts ).set_index ("date" )["count" ]
5754 return counts , []
5855
59-
6056@cache
6157def _story_list (** kwargs ):
6258 return search .story_list (** kwargs )
You can’t perform that action at this time.
0 commit comments