Source code for deephaven_enterprise.acl_generator
# Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pendingimportjpyfromdeephaven.jcompatimportj_array_listfromdeephaven.tableimportTable_j_generator_type=jpy.get_type("io.deephaven.enterprise.acl.AclFilterGenerator")
[docs]deffull_access():""" Create a filter generator that gives full access to the table. :return: a generator for full access """return_j_generator_type.fullAccess()
[docs]defno_access():""" Create a filter generator that gives no access to the table. :return: a generator for no access """return_j_generator_type.noAccess()
[docs]defgroup(group_column:str,matches_set:bool=False):""" Create a filter generator that filters rows based on group data contained within the table. :param group_column: the column containing the group data :param matches_set: if the filter should match groups within a column that is a list or array or groups (defaults to False) :return: a generator that filters based on group data in the table """return_j_generator_type.group(group_column,matches_set)
[docs]defwhere(*filters:str):""" Create a filter generator from a set of simple where clauses. :param filters: the filters to apply :return: a generator that applies the defined clauses """return_j_generator_type.where(*filters)
[docs]defwhere_in(set_namespace:str,set_table_name:str,set_group_column:str,set_filters:list,use_historical:bool,*match_expressions:str):""" Create a filter generator that applies a where_in() filter from a "Set" table containing the grouping information :param set_namespace: the namespace of the "Set" table :param set_table_name: the table name of the "Set" table :param set_group_column: the column in the "Set" table containing the group information :param set_filters: a set of expressions to filter the "Set" table :param use_historical: if the "Set" table should ceom from the historical data store :param match_expressions: the set of columns to match between the two tables :return: a filter generator that creates where_in filters """return_j_generator_type.whereIn(set_namespace,set_table_name,set_group_column,j_array_list(set_filters),use_historical,*match_expressions)
[docs]defwhere_in_table(set_table:Table,set_group_column:str,set_filters:list,*match_expressions:str):""" Create a filter generator that applies a where_in() filter from a "Set" table containing the grouping information :param set_table: the set table :param set_group_column: the column in the "Set" table containing the group information :param set_filters: a set of expressions to filter the "Set" table :param match_expressions: the set of columns to match between the two tables :return: a filter generator that creates where_in filters """return_j_generator_type.whereIn(set_table.j_table,set_group_column,j_array_list(set_filters),*match_expressions)
[docs]defconjunctive(*generators:_j_generator_type):""" Create a filter generator that conjunctively combines the input generators :param generators: the generators to combine :return: a conjunctive filter generator """return_j_generator_type.conjunctive(*generators)
[docs]defdisjunctive(*generators:_j_generator_type):""" Create a filter generator that disjunctively combines the input generators :param generators: the generators to combine :return: a disjunctively filter generator """return_j_generator_type.disjunctive(*generators)