Skip to content

Run daily partitions more frequently than once a day #18893

Answered by slopp
slopp asked this question in Q&A
Discussion options

You must be logged in to vote

The key to this type of pipeline is making sure your asset functions are safe to run the same partition multiple times. Here is example code showing a potential structure:

from dagster import (
    DailyPartitionsDefinition,
    asset,
    AssetExecutionContext,
    ScheduleEvaluationContext,
    BackfillPolicy,
    schedule,
    define_asset_job,
    AssetSelection,
    RunRequest,
    Definitions,
)
import random


def remove_partial_day(day, context):
    """Given a date, removes files for this day from s3 if they exist"""
    # for example
    context.log.info(f"Found {random.randint(0,10)} existing files for {day} to delete")
    ...


def ftp_to_s3(day, context):
    """Gets files f…

Replies: 3 comments 5 replies

Comment options

slopp
Dec 26, 2023
Maintainer Author

You must be logged in to vote
2 replies
@mattfysh
Comment options

@slopp
Comment options

slopp May 8, 2024
Maintainer Author

Answer selected by slopp
Comment options

You must be logged in to vote
3 replies
@sryza
Comment options

@mattfysh
Comment options

@slopp
Comment options

slopp May 8, 2024
Maintainer Author

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: partitions Related to Partitions
4 participants