def get_external_schedule_execution_data(
        self,
        instance,
        repository_handle,
        schedule_name,
        schedule_execution_data_mode,
        scheduled_execution_datetime_utc,
    ):
        check.inst_param(instance, "instance", DagsterInstance)
        check.inst_param(repository_handle, "repository_handle",
                         RepositoryHandle)
        check.str_param(schedule_name, "schedule_name")
        check.inst_param(schedule_execution_data_mode,
                         "schedule_execution_data_mode",
                         ScheduleExecutionDataMode)
        check.opt_inst_param(scheduled_execution_datetime_utc,
                             "scheduled_execution_datetime_utc", datetime)

        repo_origin = repository_handle.get_origin()
        args = ExternalScheduleExecutionArgs(
            instance_ref=instance.get_ref(),
            repository_origin=repo_origin,
            schedule_name=schedule_name,
            scheduled_execution_timestamp_utc=(get_timestamp_from_utc_datetime(
                scheduled_execution_datetime_utc) if
                                               scheduled_execution_datetime_utc
                                               else None),
            schedule_execution_data_mode=schedule_execution_data_mode,
        )
        recon_repo = recon_repository_from_origin(repo_origin)
        return get_external_schedule_execution(recon_repo, args)
Exemple #2
0
    def get_external_schedule_execution_data(
        self,
        instance,
        repository_handle,
        schedule_name,
        schedule_execution_data_mode,
        scheduled_execution_time,
    ):
        check.inst_param(instance, "instance", DagsterInstance)
        check.inst_param(repository_handle, "repository_handle", RepositoryHandle)
        check.str_param(schedule_name, "schedule_name")
        check.inst_param(
            schedule_execution_data_mode, "schedule_execution_data_mode", ScheduleExecutionDataMode
        )
        check.opt_inst_param(
            scheduled_execution_time, "scheduled_execution_time", pendulum.Pendulum
        )

        repo_origin = repository_handle.get_origin()
        args = ExternalScheduleExecutionArgs(
            instance_ref=instance.get_ref(),
            repository_origin=repo_origin,
            schedule_name=schedule_name,
            schedule_execution_data_mode=schedule_execution_data_mode,
            scheduled_execution_timestamp=scheduled_execution_time.timestamp()
            if scheduled_execution_time
            else None,
            scheduled_execution_timezone=scheduled_execution_time.timezone.name
            if scheduled_execution_time
            else None,
        )
        recon_repo = recon_repository_from_origin(repo_origin)
        return get_external_schedule_execution(recon_repo, args)
Exemple #3
0
    def get_external_schedule_execution_data(self, instance, repository_handle, schedule_name):
        check.inst_param(instance, 'instance', DagsterInstance)
        check.inst_param(repository_handle, 'repository_handle', RepositoryHandle)
        check.str_param(schedule_name, 'schedule_name')

        args = ExternalScheduleExecutionArgs(
            instance_ref=instance.get_ref(),
            repository_origin=repository_handle.get_origin(),
            schedule_name=schedule_name,
        )
        return get_external_schedule_execution(args)
Exemple #4
0
    def get_external_schedule_execution_data(self, instance, repository_handle,
                                             schedule_name,
                                             schedule_execution_data_mode):
        check.inst_param(instance, "instance", DagsterInstance)
        check.inst_param(repository_handle, "repository_handle",
                         RepositoryHandle)
        check.str_param(schedule_name, "schedule_name")
        check.inst_param(schedule_execution_data_mode,
                         "schedule_execution_data_mode",
                         ScheduleExecutionDataMode)

        repo_origin = repository_handle.get_origin()
        args = ExternalScheduleExecutionArgs(
            instance_ref=instance.get_ref(),
            repository_origin=repo_origin,
            schedule_name=schedule_name,
            schedule_execution_data_mode=schedule_execution_data_mode,
        )
        recon_repo = recon_repository_from_origin(repo_origin)
        return get_external_schedule_execution(recon_repo, args)
    def get_external_schedule_execution_data(
        self, instance, repository_handle, schedule_name, scheduled_execution_time,
    ):
        check.inst_param(instance, "instance", DagsterInstance)
        check.inst_param(repository_handle, "repository_handle", RepositoryHandle)
        check.str_param(schedule_name, "schedule_name")
        check.opt_inst_param(
            scheduled_execution_time, "scheduled_execution_time", pendulum.Pendulum
        )

        return get_external_schedule_execution(
            self._recon_repo,
            instance_ref=instance.get_ref(),
            schedule_name=schedule_name,
            scheduled_execution_timestamp=scheduled_execution_time.timestamp()
            if scheduled_execution_time
            else None,
            scheduled_execution_timezone=scheduled_execution_time.timezone.name
            if scheduled_execution_time
            else None,
        )
Exemple #6
0
    def get_external_schedule_execution_data(
        self,
        instance: DagsterInstance,
        repository_handle: RepositoryHandle,
        schedule_name: str,
        scheduled_execution_time,
    ) -> Union["ExternalScheduleExecutionData", "ExternalScheduleExecutionErrorData"]:
        check.inst_param(instance, "instance", DagsterInstance)
        check.inst_param(repository_handle, "repository_handle", RepositoryHandle)
        check.str_param(schedule_name, "schedule_name")
        check.opt_inst_param(scheduled_execution_time, "scheduled_execution_time", PendulumDateTime)

        return get_external_schedule_execution(
            self._recon_repo,
            instance_ref=instance.get_ref(),
            schedule_name=schedule_name,
            scheduled_execution_timestamp=scheduled_execution_time.timestamp()
            if scheduled_execution_time
            else None,
            scheduled_execution_timezone=scheduled_execution_time.timezone.name
            if scheduled_execution_time
            else None,
        )
Exemple #7
0
def schedule_execution_data_command(args):
    recon_repo = recon_repository_from_origin(args.repository_origin)
    return get_external_schedule_execution(recon_repo, args)
Exemple #8
0
def schedule_execution_data_command(args):
    return get_external_schedule_execution(args)