alpbench.util.commonΒΆ

Functions

format_insert_query(table_name, values)

Format an insert query for a given table and values.

format_select_query(table_name[, where])

Format a select query for a given table and where clause.

fullname(o)

Get the fully qualified name of a class.

instantiate_class_by_fqn(learner_fqn[, ...])

Instantiate a class by its fully qualified name.

alpbench.util.common.format_insert_query(table_name, values)[source]ΒΆ

Format an insert query for a given table and values.

Parameters:
  • table_name (str) – The name of the table to insert into.

  • values (dict) – A dictionary of column names and values to insert.

Returns:

The formatted insert query.

Return type:

str

alpbench.util.common.format_select_query(table_name, where=None)[source]ΒΆ

Format a select query for a given table and where clause.

Parameters:
  • table_name (str) – The name of the table to select from.

  • where (dict) – A dictionary of column names and values to filter by.

Returns:

The formatted select query.

Return type:

str

alpbench.util.common.fullname(o)[source]ΒΆ

Get the fully qualified name of a class.

Parameters:

o (object) – The object to get the fully qualified name of.

Returns:

The fully qualified name of the class.

Return type:

str

alpbench.util.common.instantiate_class_by_fqn(learner_fqn, learner_params={})[source]ΒΆ

Instantiate a class by its fully qualified name.

Parameters:
  • learner_fqn (str) – The fully qualified name of the class to instantiate.

  • learner_params (dict) – A dictionary of parameters to pass to the class constructor

Returns:

The instantiated class.

Return type:

object