Skip to content

Commit

Permalink
Update udfs.py
Browse files Browse the repository at this point in the history
black format
  • Loading branch information
GeekAngus authored Aug 17, 2024
1 parent 3ffeb37 commit fa79208
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions dags/ods/ig_post_insights/udfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ def save_posts_and_insights() -> None:
posts = request_posts_data()

last_post = query_last_post()
new_posts = [
post
for post in posts
if post["timestamp"] > last_post["created_at"].timestamp()
] if last_post else posts
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 fa79208

Please sign in to comment.