Skip to content

Commit

Permalink
Update dags/ods/ig_post_insights/udfs.py
Browse files Browse the repository at this point in the history
Co-authored-by: Wei Lee <[email protected]>
  • Loading branch information
GeekAngus and Lee-W authored Aug 17, 2024
1 parent fbb48ce commit 76b4987
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions dags/ods/ig_post_insights/udfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,11 @@ def save_posts_and_insights() -> None:

last_post = query_last_post()
print(last_post)
if last_post is None:
new_posts = posts
else:
new_posts = [
post
for post in posts
if post["timestamp"] > last_post["created_at"].timestamp()
]
new_posts = [
post
for post in posts
if post["timestamp"] > last_post["created_at"].timestamp()
] if last_post else posts

if not dump_posts_to_bigquery(
[
Expand Down

0 comments on commit 76b4987

Please sign in to comment.