Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix normalization map #32

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parma_mining/reddit/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def get_company_details(body: CompaniesRequest, token: str = Depends(authenticat
)
except CrawlingError as e:
logger.error(
f"Can't fetch company details from GitHub. Error: {e}"
f"Can't fetch company details from Reddit. Error: {e}"
)
collect_errors(company_id, errors, e)
continue
Expand Down
3 changes: 0 additions & 3 deletions parma_mining/reddit/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ def get_company_details(
"is_video": submission.is_video,
"over18": submission.over_18,
"permalink": submission.permalink,
"scraped_at": datetime.utcnow().strftime(
"%Y-%m-%dT%H:%M:%S.%fZ"
),
"score": submission.score,
"subreddit_name": submission.subreddit.display_name,
"subreddit_description": (
Expand Down
1 change: 0 additions & 1 deletion parma_mining/reddit/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class SubmissionModel(BaseModel):
is_video: bool | None
over18: bool | None
permalink: str | None
scraped_at: datetime | None
score: int | None
subreddit_name: str | None
subreddit_description: str | None
Expand Down
9 changes: 2 additions & 7 deletions parma_mining/reddit/normalization_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class RedditNormalizationMap:
"""Normalization map for Reddit."""

map_json = {
"SourceName": "reddit",
"Source": "reddit",
"Mappings": [
{
"SourceField": "name",
Expand Down Expand Up @@ -80,11 +80,6 @@ class RedditNormalizationMap:
"DataType": "link",
"MeasurementName": "repository homepage url",
},
{
"SourceField": "scraped_at",
"DataType": "date",
"MeasurementName": "timestamp of scraping",
},
{
"SourceField": "score",
"DataType": "int",
Expand Down Expand Up @@ -148,7 +143,7 @@ class RedditNormalizationMap:
{
"SourceField": "downvotes",
"DataType": "int",
"MeasurementName": "downvote coun of comment",
"MeasurementName": "downvote count of comment",
},
],
},
Expand Down
Loading