Skip to content

Commit

Permalink
Revert "Merge branch 'disable-twitter-temporarily' into 'master'"
Browse files Browse the repository at this point in the history
This reverts commit 3640555, reversing
changes made to 453b776.
  • Loading branch information
LinqLover committed Nov 5, 2020
1 parent 0f29c2d commit eb9f844
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 39 deletions.
12 changes: 2 additions & 10 deletions src/_fill_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
from _posts import PostsToDb, PostPerformanceToDb
from absa import AspectBasedSentimentAnalysis
from diagnostics import Diagnostics
# ---
# NOTE: We are disabling Twitter temporarily, see #369.
# TODO: Uncomment and fix this later!
# from extended_twitter_collection import TwitterExtendedDatasetToDB
# ---
from extended_twitter_collection import TwitterExtendedDatasetToDB
from gomus import GomusToDb
from topic_modeling import TopicModeling
from visitor_prediction.predict import PredictionsToDb
Expand Down Expand Up @@ -44,11 +40,7 @@ def requires(self):
yield Diagnostics()

# Extended Tweet Gathering
# ---
# NOTE: We are disabling Twitter temporarily, see #369.
# TODO: Uncomment and fix this later!
# yield TwitterExtendedDatasetToDB()
# ---
yield TwitterExtendedDatasetToDB()


class FillDbHourly(luigi.WrapperTask):
Expand Down
19 changes: 3 additions & 16 deletions src/_posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
from google_maps import GoogleMapsReviewsToDb
from gplay import GooglePlaystoreReviewsToDb
from instagram import IgToDb, IgPostPerformanceToDb
# ---
# NOTE: We are disabling Twitter temporarily, see #369.
# TODO: Uncomment and fix this later!
# from twitter import TweetsToDb, TweetPerformanceToDb
from twitter import TweetAuthorsToDb
# ---
from twitter import TweetsToDb, TweetPerformanceToDb, TweetAuthorsToDb


class PostsToDb(luigi.WrapperTask):
Expand All @@ -32,11 +27,7 @@ def requires(self):
yield GooglePlaystoreReviewsToDb()
yield IgToDb()
yield TweetAuthorsToDb()
# ---
# NOTE: We are disabling Twitter temporarily, see #369.
# TODO: Uncomment and fix this later!
# yield TweetsToDb()
# ---
yield TweetsToDb()

if self.fetch_performance:
yield PostPerformanceToDb()
Expand All @@ -48,8 +39,4 @@ class PostPerformanceToDb(luigi.WrapperTask):
def requires(self):
yield FbPostPerformanceToDb()
yield IgPostPerformanceToDb()
# ---
# NOTE: We are disabling Twitter temporarily, see #369.
# TODO: Uncomment and fix this later!
# yield TweetPerformanceToDb()
# ---
yield TweetPerformanceToDb()
6 changes: 1 addition & 5 deletions tests/schema/check_posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ def test_post_sources(self):
"Google Maps",
"Instagram",
"Google Play", "Apple Appstore",
# ---
# NOTE: We are disabling Twitter temporarily, see #369.
# TODO: Uncomment and fix this later!
# "Twitter"
# ---
"Twitter"
},
sources,
msg="Expected sources are not met by post view"
Expand Down
9 changes: 1 addition & 8 deletions tests/test_twitter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import datetime as dt
import pandas as pd
import unittest
from unittest.mock import patch

from freezegun import freeze_time
Expand All @@ -14,11 +13,6 @@
class TestFetchTwitter(DatabaseTestCase):
"""Tests the FetchTwitter task."""

# ---
# NOTE: Twitterscraper is broken ATM, so we are disabling it temporarily.
# See #369. TODO: Fix this later!
@unittest.expectedFailure
# ---
@patch.object(FetchTwitter, 'output')
def test_fetch_twitter(self, output_mock):
output_target = MockTarget('raw_out', format=UTF8)
Expand All @@ -32,8 +26,7 @@ def test_fetch_twitter(self, output_mock):
'timestamp']

with freeze_time('2020-02-06'):
# On this day our team's account has posted a related tweet
# See https://twitter.com/bpfn2020/status/1225435275301654531
# on this day our team's account had sent a related tweet
FetchTwitter(timespan=dt.timedelta(days=1)).run()

with output_target.open('r') as output_file:
Expand Down

0 comments on commit eb9f844

Please sign in to comment.