graviti.dataframe.sql.array#

The implementation of the search related array.

Module Contents#

Classes#

LogicalOperatorsMixin

A mixin for dynamically implementing logical operators.

EqualOperatorsMixin

A mixin for dynamically implementing euqal operators.

ComparisonOperatorsMixin

A mixin for dynamically implementing comparison operators.

ArithmeticOperatorsMixin

A mixin for dynamically implementing arithmetic operators.

Array

One-dimensional array for portex builtin type array.

BooleanArray

One-dimensional array for portex builtin type array with the boolean items.

StringArray

One-dimensional array for portex builtin type array with the string and enum items.

EnumArray

One-dimensional array for portex builtin type array with the string and enum items.

TemporalArrayBase

One-dimensional array for portex builtin temporal types.

DateArray

One-dimensional array for portex builtin date type.

TimeArray

One-dimensional array for portex builtin time type.

TimestampArray

One-dimensional array for portex builtin timestamp type.

TimedeltaArray

One-dimensional array for portex builtin timedelta type.

NumberArray

One-dimensional array for portex builtin type array with the numerical items.

DataFrame

The Two-dimensional array for the search.

ArrayDistributor

A distributor to instance DataFrame, ArrayScalar by different array items.

ArraySeries

The One-dimensional array for the search.

class graviti.dataframe.sql.array.LogicalOperatorsMixin(expr, schema, upper_expr)[source]#

Bases: graviti.dataframe.sql.container.ArrayContainer

A mixin for dynamically implementing logical operators.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.EqualOperatorsMixin(expr, schema, upper_expr)[source]#

Bases: graviti.dataframe.sql.container.ArrayContainer

A mixin for dynamically implementing euqal operators.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.ComparisonOperatorsMixin(expr, schema, upper_expr)[source]#

Bases: graviti.dataframe.sql.container.ArrayContainer

A mixin for dynamically implementing comparison operators.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.ArithmeticOperatorsMixin(expr, schema, upper_expr)[source]#

Bases: graviti.dataframe.sql.container.ArrayContainer

A mixin for dynamically implementing arithmetic operators.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.Array(expr, schema, upper_expr)[source]#

Bases: graviti.dataframe.sql.container.ArrayContainer

One-dimensional array for portex builtin type array.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

query(self, func)[source]#

Query the data of an ArraySeries with a lambda function.

Parameters

func (Callable[[Any], Any]) – The query function.

Returns

The ArraySeries with the query expression.

Return type

Array

any(self)[source]#

Whether any element is True.

Returns

The BooleanSeries with the any expression.

Return type

graviti.dataframe.sql.scalar.BooleanScalar

all(self)[source]#

Whether all elements are True.

Returns

The BooleanSeries with the all expression.

Return type

graviti.dataframe.sql.scalar.BooleanScalar

class graviti.dataframe.sql.array.BooleanArray(expr, schema, upper_expr)[source]#

Bases: Array, LogicalOperatorsMixin, EqualOperatorsMixin

One-dimensional array for portex builtin type array with the boolean items.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.StringArray(expr, schema, upper_expr)[source]#

Bases: Array, LogicalOperatorsMixin, EqualOperatorsMixin

One-dimensional array for portex builtin type array with the string and enum items.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.EnumArray(expr, schema, upper_expr)[source]#

Bases: Array, EqualOperatorsMixin

One-dimensional array for portex builtin type array with the string and enum items.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.TemporalArrayBase(expr, schema, upper_expr)[source]#

Bases: Array, EqualOperatorsMixin, ComparisonOperatorsMixin

One-dimensional array for portex builtin temporal types.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.DateArray(expr, schema, upper_expr)[source]#

Bases: TemporalArrayBase

One-dimensional array for portex builtin date type.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.TimeArray(expr, schema, upper_expr)[source]#

Bases: TemporalArrayBase

One-dimensional array for portex builtin time type.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.TimestampArray(expr, schema, upper_expr)[source]#

Bases: TemporalArrayBase

One-dimensional array for portex builtin timestamp type.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.TimedeltaArray(expr, schema, upper_expr)[source]#

Bases: TemporalArrayBase

One-dimensional array for portex builtin timedelta type.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

class graviti.dataframe.sql.array.NumberArray(expr, schema, upper_expr)[source]#

Bases: Array, ComparisonOperatorsMixin, ArithmeticOperatorsMixin

One-dimensional array for portex builtin type array with the numerical items.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

size(self)[source]#

Get the length of array series.

Returns

The NumberScalar with the size expression.

Return type

graviti.dataframe.sql.scalar.NumberScalar

max(self)[source]#

Get the max value of array series.

Returns

The NumberScalar with the max expression.

Return type

graviti.dataframe.sql.scalar.NumberScalar

min(self)[source]#

Get the min value of array series.

Returns

The NumberScalar with the min expression.

Return type

graviti.dataframe.sql.scalar.NumberScalar

sum(self)[source]#

Get the sum of array series.

Returns

The NumberScalar with the sum expression.

Return type

graviti.dataframe.sql.scalar.NumberScalar

class graviti.dataframe.sql.array.DataFrame(expr, schema, upper_expr)[source]#

Bases: graviti.dataframe.sql.container.ArrayContainer

The Two-dimensional array for the search.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

query(self, func)[source]#

Query the data of an ArraySeries with a lambda function.

Parameters

func (Callable[[Any], Any]) – The query function.

Returns

The DataFrame with the query expression.

Return type

DataFrame

class graviti.dataframe.sql.array.ArrayDistributor(expr, schema, upper_expr)[source]#

Bases: graviti.dataframe.sql.container.ArrayContainer

A distributor to instance DataFrame, ArrayScalar by different array items.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –

classmethod from_upper(cls, expr, schema)[source]#

Instantiate a Search object from the upper level.

Parameters
  • expr (graviti.dataframe.sql.container._E) – The expression of the search.

  • schema (graviti.portex.PortexType) – The schema of the series.

Returns

The loaded object.

Return type

graviti.dataframe.sql.container.ArrayContainer

class graviti.dataframe.sql.array.ArraySeries(expr, schema, upper_expr)[source]#

Bases: graviti.dataframe.sql.container.ArrayContainer

The One-dimensional array for the search.

Parameters
  • expr (_E) –

  • schema (graviti.portex.PortexType) –

  • upper_expr (_E) –