Skip to content

Commit

Permalink
Merge pull request #202 from SocialChangeLab/bugfix/issue-192/fix-ful…
Browse files Browse the repository at this point in the history
…ltext-api-bug-2

Bugfix/issue 192/fix fulltext api bug 2
davidpomerenke authored Jul 18, 2024
2 parents 41d4e48 + 65388ec commit 700a79e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend-python/media_impact_monitor/fulltexts.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,9 @@

@cache
def get_fulltexts(q: FulltextSearch) -> pd.DataFrame | None:
assert q.topic or q.organizers or q.query or q.event_id
assert (
q.topic or q.organizers or q.query or q.event_id
), "One of 'topic', 'organizers', 'query', or 'event_id' must be provided."
keywords = load_keywords()
num_filters = sum(
[bool(q.topic), bool(q.organizers), bool(q.query), bool(q.event_id)]
@@ -64,6 +66,10 @@ def get_fulltexts(q: FulltextSearch) -> pd.DataFrame | None:

print(f"Looking for news fulltexts that match: '{query}'")

assert (
q.start_date and q.end_date
), "Both start_date and end_date must be provided; either explicitly or through the event_id."

match q.media_source:
case "news_online":
df = get_mediacloud_fulltexts(

0 comments on commit 700a79e

Please sign in to comment.