gravitino.dto.util.dto_converters.DTOConverters

class gravitino.dto.util.dto_converters.DTOConverters

Bases: object

Utility class for converting between DTOs and domain objects.

__init__()

Methods

__init__()

from_dto()

from_dtos()

Converts a list of DTOs to the corresponding API objects.

from_function_arg(arg)

Converts a FunctionArg DTO to an Expression.

from_function_args(args)

Converts a FunctionArg DTO to an Expression.

to_dto()

to_dtos()

to_function_arg(expression)

Converts an Expression to an FunctionArg DTO.

to_function_args(expressions)

Converts a list of Expressions to a list of FunctionArg DTOs.

to_table_update_request(change)

static from_dtos(dtos: list[ColumnDTO]) → list[Column]
static from_dtos(dtos: list[IndexDTO]) → list[Index]
static from_dtos(dtos: list[SortOrderDTO]) → list[SortOrder]
static from_dtos(dtos: list[RepresentationDTO]) → list[Representation]
static from_dtos(dtos: list[Partitioning]) → list[Transform]

Converts a list of DTOs to the corresponding API objects.

Args:

dtos: The DTOs to be converted.

Returns:

The converted objects.

static from_function_arg(arg: FunctionArg) → Expression

Converts a FunctionArg DTO to an Expression.

Args:

arg (FunctionArg): The function argument DTO to be converted.

Returns:

Expression: The expression.

static from_function_args(args: list[gravitino.dto.rel.expressions.function_arg.FunctionArg]) → list[gravitino.api.rel.expressions.expression.Expression]

Converts a FunctionArg DTO to an Expression.

Args:

args (list[FunctionArg]): The function argument DTOs to be converted.

Returns:

list[Expression]: The list of expressions.

static to_function_arg(expression: Expression) → FunctionArg

Converts an Expression to an FunctionArg DTO.

Args:

expression (Expression): The expression to be converted.

Returns:

FunctionArg: The expression DTO.

static to_function_args(expressions: list[gravitino.api.rel.expressions.expression.Expression]) → list[gravitino.dto.rel.expressions.function_arg.FunctionArg]

Converts a list of Expressions to a list of FunctionArg DTOs.

Args:

expressions (list[Expression]): The expressions to be converted.

Returns:

list[FunctionArg]: The list of expression DTOs.