brave / brave/source-suggestions

source-sim-matrix job failing for some regions

Open
#139 0 comments 0 reactions 1 assignee Claimed by @porteron View on GitHub
bug
Dominant language
Python
Stars
30
Forks
7
PR merge metrics
No merged PRs in 30d

Description

```
2025-01-27 17:29:29 [warning ] Source The Indian Express has no articles. Skipping...
2025-01-27 17:29:29 [warning ] Source The New Indian Express has no articles. Skipping...
2025-01-27 17:29:29 [warning ] Source The New York Times has no articles. Skipping...
2025-01-27 17:29:29 [warning ] Source The New Yorker has no articles. Skipping...
2025-01-27 17:29:29 [warning ] Source The News Minute has no articles. Skipping...
2025-01-27 17:29:29 [warning ] Source The Quint has no articles. Skipping...
115it [00:00, 1607.96it/s]
Traceback (most recent call last):
File "/app/source-similarity-matrix.py", line 70, in
f"Source {sources_df[sources_df.publisher_id == publisher_id].publisher_name.item()} has no articles. Skipping...")
File "/usr/local/lib/python3.9/site-packages/pandas/core/base.py", line 347, in item
raise ValueError("can only convert an array of size 1 to a Python scalar")
ValueError: can only convert an array of size 1 to a Python scalar
```

- [ ] If there is an error do not fail the entire job, wrap in a try/except block and continue processing
- [ ] Add error logging for this failing condition, include the feed name if possible.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.