class LogTargetSchema(_ApiCallSchema): run_uid = fields.UUID(required=True) task_run_uid = fields.UUID(required=True) task_run_name = fields.String() task_run_attempt_uid = fields.UUID(required=True) target_path = fields.String() param_name = fields.String(allow_none=True) task_def_uid = fields.UUID(allow_none=True) operation_type = EnumField(DbndTargetOperationType) operation_status = EnumField(DbndTargetOperationStatus) value_preview = fields.String(allow_none=True) data_dimensions = fields.List(fields.Integer(), allow_none=True) data_schema = fields.String(allow_none=True) data_hash = fields.String(allow_none=True)
class TaskDefinitionParamSchema(ApiObjectSchema): """ Based on TaskDefinitionParam object """ name = fields.String() default = fields.String(allow_none=True) description = fields.String() group = EnumField(ParameterGroup) kind = EnumField(_ParameterKind) load_on_build = fields.Boolean() significant = fields.Boolean() value_type = fields.String() @post_load def make_task_definition_param(self, data, **kwargs): return _as_dotted_dict(**data)
class TaskRunAttemptSchema(ApiStrictSchema): task_run_uid = fields.UUID() task_run_attempt_uid = fields.UUID() state = EnumField(TaskRunState, allow_none=True) timestamp = fields.DateTime(allow_none=True) first_error = fields.Nested(ErrorInfoSchema, allow_none=True) latest_error = fields.Nested(ErrorInfoSchema, allow_none=True) attempt_number = fields.Number(allow_none=True) source = fields.Str(allow_none=True) start_date = fields.DateTime(allow_none=True) end_date = fields.DateTime(allow_none=True) external_links_dict = fields.Dict(allow_none=True)
class TaskRunAttemptUpdateArgsSchema(ApiObjectSchema): task_run_uid = fields.UUID() task_run_attempt_uid = fields.UUID() state = EnumField(TaskRunState, allow_none=True) timestamp = fields.DateTime(allow_none=True) error = fields.Nested(ErrorInfoSchema, allow_none=True) attempt_number = fields.Number(allow_none=True) source = fields.Str(allow_none=True) start_date = fields.DateTime(allow_none=True) @post_load def make_object(self, data, **kwargs): return TaskRunAttemptUpdateArgs(**data)
class TaskRunInfoSchema(ApiObjectSchema): task_run_uid = fields.UUID() task_run_attempt_uid = fields.UUID() task_definition_uid = fields.UUID() run_uid = fields.UUID() task_id = fields.String() task_signature = fields.String() task_signature_source = fields.String() task_af_id = fields.String() execution_date = fields.DateTime() name = fields.String() env = fields.String() command_line = fields.String() functional_call = fields.String() has_downstreams = fields.Boolean() has_upstreams = fields.Boolean() is_reused = fields.Boolean() is_dynamic = fields.Boolean() is_system = fields.Boolean() is_skipped = fields.Boolean() is_root = fields.Boolean() output_signature = fields.String() state = EnumField(TaskRunState) target_date = fields.Date(allow_none=True) log_local = fields.String(allow_none=True) log_remote = fields.String(allow_none=True) version = fields.String() task_run_params = fields.Nested(TaskRunParamSchema, many=True) external_links = fields.Dict(allow_none=True) @post_load def make_task_run(self, data, **kwargs): return TaskRunInfo(**data)
class RunInfoSchema(ApiStrictSchema): root_run_uid = fields.UUID() run_uid = fields.UUID() job_name = fields.String() project_name = fields.String(allow_none=True) user = fields.String() name = fields.String() description = fields.String(allow_none=True) state = EnumField(RunState) start_time = fields.DateTime() end_time = fields.DateTime(allow_none=True) # deprecate dag_id = fields.String() cmd_name = fields.String(allow_none=True) execution_date = fields.DateTime() # move to task target_date = fields.Date(allow_none=True) version = fields.String(allow_none=True) driver_name = fields.String() is_archived = fields.Boolean() env_name = fields.String(allow_none=True) cloud_type = fields.String() trigger = fields.String() task_executor = fields.String(allow_none=True) root_run = fields.Nested(RootRunInfoSchema) scheduled_run = fields.Nested(ScheduledRunInfoSchema, allow_none=True) sends_heartbeat = fields.Boolean(default=False, allow_none=True) scheduled_job_name = fields.String(allow_none=True) scheduled_date = fields.DateTime(allow_none=True) external_links = fields.Dict(allow_none=True) @post_load def make_run_info(self, data, **kwargs): return _as_dotted_dict(**data)
class SetUnfinishedTasksStateShcmea(_ApiCallSchema): run_uid = fields.UUID() state = EnumField(TaskRunState) timestamp = fields.DateTime()
class SetDatabandRunStateSchema(_ApiCallSchema): run_uid = fields.UUID(required=True) state = EnumField(RunState) timestamp = fields.DateTime(required=False, default=None, missing=None)
class AddTaskRunsSchema(_ApiCallSchema): task_runs_info = fields.Nested(TaskRunsInfoSchema) source = EnumField(UpdateSource, allow_none=True)