easy_sql.sql_processor.funcs_common

Module Contents

Classes

AlertFunc

AnalyticsFuncs

ColumnFuncs

PartitionFuncs

TableFuncs

class easy_sql.sql_processor.funcs_common.AlertFunc(backend, alerter)
Parameters
alert(self, step, context, rule_name, pass_condition, alert_template, mentioned_users)
Parameters
alert_exception_handler(self, rule_name, mentioned_users)
Parameters
  • rule_name (str) –

  • mentioned_users (str) –

alert_with_backend(self, backend, step, context, rule_name, pass_condition, alert_template, mentioned_users)
Parameters
class easy_sql.sql_processor.funcs_common.AnalyticsFuncs(backend)
Parameters

backend (easy_sql.sql_processor.backend.Backend) –

data_profiling_report(self, table, query, output_folder, max_count='50000', include_correlations='true', types='html')
Parameters
  • table (str) –

  • query (str) –

  • output_folder (str) –

  • max_count (str) –

  • include_correlations (str) –

  • types (Union[str, List[str]]) –

class easy_sql.sql_processor.funcs_common.ColumnFuncs(backend)
Parameters

backend (easy_sql.sql_processor.backend.Backend) –

all_cols_prefixed_with_exclusion_expr(self, table_name, prefix, *cols_to_exclude)
Parameters
  • table_name (str) –

  • prefix (str) –

  • cols_to_exclude (str) –

Return type

str

all_cols_with_exclusion_expr(self, table_name, *cols_to_exclude)
Parameters
  • table_name (str) –

  • cols_to_exclude (str) –

Return type

str

all_cols_without_one_expr(self, table_name, *cols_to_exclude)
Parameters
  • table_name (str) –

  • cols_to_exclude (str) –

Return type

str

class easy_sql.sql_processor.funcs_common.PartitionFuncs(backend)
Parameters

backend (easy_sql.sql_processor.backend.Backend) –

ensure_dwd_partition_exists(self, step, table_name, partition_value, *foreign_key_cols)
Parameters
Return type

bool

ensure_partition_exists(self, step, *args)
Parameters

step (easy_sql.sql_processor.step.Step) –

Return type

bool

ensure_partition_or_first_partition_exists(self, step, *args)
Parameters

step (easy_sql.sql_processor.step.Step) –

Return type

bool

ensure_table_partition_exists(self, step, partition_value, table, *tables)
Parameters
Return type

bool

ensure_table_partition_or_first_partition_exists(self, step, partition_value, table, *tables)
Parameters
Return type

bool

get_first_partition(self, table_name)
Parameters

table_name (str) –

Return type

str

get_first_partition_optional(self, table_name)
Parameters

table_name (str) –

Return type

Optional[str]

get_last_partition(self, table_name)
Parameters

table_name (str) –

Return type

str

get_partition_col(self, table_name)
Parameters

table_name (str) –

abstract get_partition_cols(self, table_name)
Parameters

table_name (str) –

Return type

List[str]

get_partition_or_first_partition(self, table_name, partition_value)
Parameters
  • table_name (str) –

  • partition_value (str) –

get_partition_values_as_joined_str(self, table_name)
Parameters

table_name (str) –

Return type

str

has_partition_col(self, table_name)
Parameters

table_name (str) –

is_first_partition(self, table_name, partition_value)
Parameters
  • table_name (str) –

  • partition_value (str) –

Return type

bool

is_not_first_partition(self, table_name, partition_value)
Parameters
  • table_name (str) –

  • partition_value (str) –

Return type

bool

partition_exists(self, table_name, partition_value)
Parameters
  • table_name (str) –

  • partition_value (str) –

Return type

bool

partition_not_exists(self, table_name, partition_value)
Parameters
  • table_name (str) –

  • partition_value (str) –

Return type

bool

previous_partition_exists(self, table_name, curr_partition_value_as_dt)
Parameters
  • table_name (str) –

  • curr_partition_value_as_dt (str) –

Return type

bool

class easy_sql.sql_processor.funcs_common.TableFuncs(backend)
Parameters

backend (easy_sql.sql_processor.backend.Backend) –

check_not_null_column_in_table(self, step, table_name, not_null_column, query=None)
Parameters
Return type

bool

ensure_no_null_data_in_table(self, step, table_name, query=None)
Parameters
Return type

bool