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 memes not ETLing from meme_raw_telegram to meme tables #76

Merged
merged 6 commits into from
Jul 27, 2024
Merged
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
6 changes: 4 additions & 2 deletions src/storage/etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ async def update_or_create_memes(transformed_memes, memes_not_in_memes_table):
create_these_memes = [
m
for m in transformed_memes
if (m["meme_source_id"], m["raw_meme_id"]) in memes_not_in_memes_table
if {"meme_source_id": m["meme_source_id"], "raw_meme_id": m["raw_meme_id"]}
in memes_not_in_memes_table
]
if len(create_these_memes):
await execute(insert(meme).values(create_these_memes))
Expand All @@ -308,7 +309,8 @@ async def update_or_create_memes(transformed_memes, memes_not_in_memes_table):
m
| {"status": "created" if m["status"] == "broken_content_link" else m["status"]}
for m in transformed_memes
if (m["meme_source_id"], m["raw_meme_id"]) not in memes_not_in_memes_table
if {"meme_source_id": m["meme_source_id"], "raw_meme_id": m["raw_meme_id"]}
not in memes_not_in_memes_table
]

for m in update_these_memes:
Expand Down
Loading