Skip to content

Commit

Permalink
Merge branch 'main' into add-wiki-current-events-portal-source
Browse files Browse the repository at this point in the history
  • Loading branch information
complementizer authored Dec 2, 2023
2 parents c9f6cec + 31ee570 commit 696d304
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ IMAGE_URI ?= $(REGION)-docker.pkg.dev/$(PROJECT_ID)/$(REPOSITORY_NAME)/$(IMAGE_N

.PHONY: build
build:
docker build -t $(IMAGE_URI) -f Dockerfile .
docker build --network host -t $(IMAGE_URI) -f Dockerfile .

.PHONY: push
push:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.3.2
13 changes: 9 additions & 4 deletions news_signals/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
from abc import abstractmethod
from collections import Counter, defaultdict
from typing import List
from typing import List, Optional
import json
import base64
from pathlib import Path
Expand Down Expand Up @@ -918,8 +918,13 @@ def add_wikimedia_pageviews_timeseries(
granularity='daily',
wikidata_client=wikidata_client,
wikimedia_endpoint=wikimedia_endpoint,
)
self.timeseries_df['wikimedia_pageviews'] = pageviews_df['wikimedia_pageviews'].values
)
try:
self.timeseries_df['wikimedia_pageviews'] = pageviews_df['wikimedia_pageviews'].values
except TypeError as e:
logger.error(e)
logger.warning('Retrieved wikimedia pageviews dataframe is None, not adding to signal')

return self

def add_wikipedia_current_events(
Expand Down Expand Up @@ -1214,7 +1219,7 @@ def __init__(
self,
name: str,
components: List[Signal],
metadata: dict = None
metadata: Optional[dict] = None
):
super().__init__(name, metadata=metadata)
self.components = components
Expand Down
3 changes: 2 additions & 1 deletion news_signals/signals_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

logger = create_logger(__name__, level=logging.INFO)

MAX_BODY_TOKENS = 500
MAX_BODY_TOKENS = 1000
DEFAULT_METADATA = {
'name': 'News Signals Dataset'
}
Expand Down Expand Up @@ -328,6 +328,7 @@ def reduce_aylien_story(
"categories": s["categories"],
"industries": s["industries"],
"smart_tagger_categories": smart_cats,
"media": s["media"],
"clusters": s["clusters"]
}, **{f: s[f] for f in additional_fields}
)
Expand Down

0 comments on commit 696d304

Please sign in to comment.