Coder Social home page Coder Social logo

Comments (2)

OmranKaddah avatar OmranKaddah commented on May 30, 2024 1

Just a note to those who are reading this and wondering what to do about the time zone. This can be set in DailyPartitionsDefinition. @garethbrickman thanks for the detailed explanation.

from dagster.

garethbrickman avatar garethbrickman commented on May 30, 2024

The reason you cannot specify both the cron_schedule/execution_timezone parameters and the day_of_month/day_of_week/hour_of_day/minute_of_hour parameters at the same time when creating a schedule from a partitioned job is due to the design of the Dagster scheduling system. The build_schedule_from_partitioned_job function is designed to create a schedule that aligns with the partitioning of the job. This means that the schedule's frequency and timing should match the intervals defined by the job's partitions.

When you define a partitioned job, you are effectively setting up a structure for how the data should be processed over time. For example, if you have a job that processes data daily, you would set up daily partitions. The schedule for this job should then naturally run once per day to process each partition.

The day_of_month, day_of_week, hour_of_day, and minute_of_hour parameters are used to specify the exact time within the partition's interval when the job should run. These parameters are meant to provide a convenient way to set the schedule based on the partition's natural frequency without having to manually calculate the corresponding cron expression.

On the other hand, the cron_schedule parameter allows you to specify a custom cron expression that defines the schedule's frequency and timing in a more granular and flexible way. The execution_timezone parameter is used in conjunction with cron_schedule to ensure that the schedule runs at the correct local time, taking into account time zone differences.

Allowing both sets of parameters to be specified would create ambiguity and potential conflicts in the scheduling logic. For instance, if you set a daily partition but then provide a cron expression that runs every hour, it would be unclear how the schedule should reconcile the hourly cron expression with the daily partitioning of the job.

To maintain clarity and prevent such conflicts, Dagster requires you to use either the partition-based parameters or the cron-based parameters , but not both. This ensures that the schedule is consistent with the partitioning of the job and that there is a single source of truth for when and how often the job should run.

from dagster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.