ads.feature_store.query package#

ads.feature_store.query package#

class ads.feature_store.query.filter.Filter(feature, condition, value, **kwargs)[source]#

Bases: Builder

Represents a filter for a query.

CONST_CONDITION = 'condition'#
CONST_FEATURE = 'feature'#
CONST_VALUE = 'value'#
property condition#
property feature#
to_dict()[source]#

Converts the object to dictionary with kind, type and spec as keys.

Parameters:

**kwargs (Dict) –

The additional arguments. - filter_by_attribute_map: bool

If True, then in the result will be included only the fields presented in the attribute_map.

property value#
with_condition(condition)[source]#

Sets the condition to apply to the feature.

Parameters:

condition (str) – The condition to apply to the feature.

with_feature(feature)[source]#

Sets the feature to filter on.

Parameters:

feature (str) – The feature to filter on.

with_value(value)[source]#

Sets the value to filter for.

Parameters:

value (str) – The value to filter for.

class ads.feature_store.query.filter.Logic(type, left_f=None, right_f=None, left_l=None, right_l=None, **kwargs)[source]#

Bases: Builder

A class representing a logical operation on filters.

AND = 'AND'#
classmethod And(left_f=None, right_f=None, left_l=None, right_l=None)[source]#
CONST_LEFT_FILTER = 'leftFilter'#
CONST_LEFT_LOGIC = 'leftLogic'#
CONST_RIGHT_FILTER = 'rightFilter'#
CONST_RIGHT_LOGIC = 'rightLogic'#
CONST_TYPE = 'type'#
OR = 'OR'#
classmethod Or(left_f=None, right_f=None, left_l=None, right_l=None)[source]#
SINGLE = 'SINGLE'#
classmethod Single(left_f)[source]#
property left_filter#
property left_logic#
property right_filter#
property right_logic#
to_dict()[source]#

Converts the object to dictionary with kind, type and spec as keys.

Parameters:

**kwargs (Dict) –

The additional arguments. - filter_by_attribute_map: bool

If True, then in the result will be included only the fields presented in the attribute_map.

property type#

The type of the object as showing in YAML.

This implementation returns the class name with the first letter coverted to lower case.

with_left_filter(left_filter)[source]#

Sets the left filter of the logic.

Parameters:#

left_filter: Filter or None

The left filter of the logic.

with_left_logic(left_logic)[source]#

Sets the left logic of the operation.

Parameters:#

left_logic: Logic or None

The left logic of the operation.

with_right_filter(right_filter)[source]#

Sets the right filter of the logic.

Parameters:#

right_filter: Filter or None

The right filter of the logic.

with_right_logic(right_logic)[source]#

Sets the right logic of the operation.

Parameters:#

right_logic: Logic or None

The right logic of the operation.

with_type(type)[source]#

Sets the type of the logic.

Parameters:#

type: str

A string representing the type of the logic to be performed.

class ads.feature_store.query.join.Join(query, on, left_on, right_on, join_type: JoinType = JoinType.INNER)[source]#

Bases: Builder

The Join class is used to join two tables or datasets.

Parameters:
  • query (The table or dataset to join.) –

  • left_on (A list of column names from the left table to join on.) –

  • right_on (A list of column names from the right table to join on.) –

  • (JoinType) (join_type) –

with_query(query: 'Query') "Join": Sets the query attribute.#
with_left_on(left_on: List[str]) "Join": Sets the left_on attribute.[source]#
with_right_on(right_on: List[str]) "Join": Sets the right_on attribute.[source]#
with_join_type(join_type: JoinType) "Join": Sets the join_type attribute.[source]#
to_dict() dict: Returns the Join as a dictionary.[source]#
CONST_JOIN_TYPE = 'joinType'#
CONST_LEFT_ON = 'leftOn'#
CONST_ON = 'on'#
CONST_QUERY = 'query'#
CONST_RIGHT_ON = 'rightOn'#
property join_type: list#
property left_on: list#
property on: List[str]#
property right_on: list#
property sub_query: Query#
to_dict()[source]#

Returns the Join as dictionary.

with_join_type(join_type: JoinType) Join[source]#

Sets the left feature details.

Parameters:

join_type (JoinType) – The join type: Defaults to INNER

Returns:

The Join instance (self)

Return type:

Join

with_left_on(left_on: List[str]) Join[source]#

Sets the left feature details.

Parameters:

left_on (List[str]) – The left feature to join on

Returns:

The Join instance (self)

Return type:

Join

with_on(on: List[str] = [])[source]#

Sets the query.

Parameters:

on (List[str]) – The on clause .

Returns:

The Join instance (self)

Return type:

Join

with_right_on(right_on: List[str]) Join[source]#

Sets the left feature details.

Parameters:

right_on (List[str]) – The right feature to join on

Returns:

The Join instance (self)

Return type:

Join

with_sub_query(sub_query: Query) Join[source]#

Sets the query.

Parameters:

sub_query (Query) – The query .

Returns:

The Join instance (self)

Return type:

Join