Skip to main content

OutputReader

OutputReader provides an abstracted OutputReader interface. The plugins are responsible to provide the implementations for the interface. Some helper implementations can be found in ioutils

Methods


IsError()

@classmethod
def IsError(
ctx: context.Context
) - > (bool, error)

Returns true if an error was detected when reading the output and false if no error was detected.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, allowing for cancellation and timeouts.

Returns

TypeDescription
(bool, error)A boolean indicating if an error was detected, and an error object if a system problem occurred.

ReadError()

@classmethod
def ReadError(
ctx: context.Context
) - > ([ExecutionError](executionerror.md?sid=flyteplugins_go_tasks_pluginmachinery_io_executionerror), error)

Returns the error as type ExecutionError.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, allowing for cancellation and timeouts.

Returns

TypeDescription
([ExecutionError](executionerror.md?sid=flyteplugins_go_tasks_pluginmachinery_io_executionerror), error)The ExecutionError if a user error occurred, and an error object if a system problem occurred.

IsFile()

@classmethod
def IsFile(
ctx: context.Context
) - > bool

Returns true if the outputs are using the OutputFilePaths specified files. If so it allows the system to optimize the reads of the files.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, allowing for cancellation and timeouts.

Returns

TypeDescription
boolA boolean indicating whether the outputs are file-based, which can enable optimized read operations.

Exists()

@classmethod
def Exists(
ctx: context.Context
) - > (bool, error)

Returns true if the output exists, false otherwise.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, allowing for cancellation and timeouts.

Returns

TypeDescription
(bool, error)A boolean indicating whether the output exists, and an error object if a system problem occurred during the check.

Read()

@classmethod
def Read(
ctx: context.Context
) - > (*core.LiteralMap, *ExecutionError, error)

Returns the output as a core.LiteralMap (nil if void), an ExecutionError if a user error occurred when reading the output, and an error to indicate system problems.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, allowing for cancellation and timeouts.

Returns

TypeDescription
(*core.LiteralMap, *ExecutionError, error)The output as a LiteralMap, an ExecutionError if a user-level error occurred, and a system error if a problem prevented reading.

DeckExists()

@classmethod
def DeckExists(
ctx: context.Context
) - > (bool, error)

Checks if the deck file has been generated.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, allowing for cancellation and timeouts.

Returns

TypeDescription
(bool, error)A boolean indicating whether the deck file exists, and an error object if a system problem occurred during the check.