Skip to content

Commit

Permalink
Merge pull request #57 from SocialChangeLab/issue-46-fix-mediacloud
Browse files Browse the repository at this point in the history
test(mediacloud): enable mediacloud code (closes #46)
  • Loading branch information
davidpomerenke authored Apr 10, 2024
2 parents 2bedf16 + f7da3ba commit 30df02b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ def get_mediacloud_counts(
end_date: pd.Timestamp = end,
countries: list | None = None,
):
raise NotImplementedError("This function does not currently work.")
assert len(countries) == 1, "Currently only supports one country at a time."
collection_ids: list[str] = []
collection_ids: list[int] = []
if countries:
collection_ids = []
for country in countries:
Expand All @@ -39,7 +37,6 @@ def get_mediacloud_counts(
query=query,
start_date=start_date.to_pydatetime().date(),
end_date=end_date.to_pydatetime().date(),
# There seems to be a bug in the library relating to `collection_ids`:
collection_ids=collection_ids,
)
df = pd.DataFrame(data)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import pandas as pd
import pytest
from media_impact_monitor.data_loaders.news_online.mediacloud_ import (
get_mediacloud_counts,
)


@pytest.mark.skip(reason="There are some bugs with the mediacloud library.")
def test_get_counts_mediacloud():
df = get_mediacloud_counts(
"Fridays for Future",
Expand Down

0 comments on commit 30df02b

Please sign in to comment.