def test_auth_success_with_insecure_channel_on_core_url( self, insecure_core_server_with_auth): client = Client( core_url=f"localhost:{insecure_core_server_with_auth}", enable_auth=True, auth_token=_FAKE_JWT_TOKEN, ) client.list_feature_tables()
def test_get_list_alltypes(client: Client, alltypes_entity: Entity, alltypes_featuretable: FeatureTable): # ApplyEntity client.apply_entity(alltypes_entity) # GetEntity Check assert client.get_entity(name="alltypes_id") == alltypes_entity # ListEntities Check alltypes_filtering_labels = {"cat": "alltypes"} actual_alltypes_entities = client.list_entities( labels=alltypes_filtering_labels) assert len(actual_alltypes_entities) == 1 # ApplyFeatureTable client.apply_feature_table(alltypes_featuretable) # GetFeatureTable Check actual_get_feature_table = client.get_feature_table(name="alltypes") assert actual_get_feature_table == alltypes_featuretable # ListFeatureTables Check actual_list_feature_table = [ ft for ft in client.list_feature_tables() if ft.name == "alltypes" ][0] assert actual_list_feature_table == alltypes_featuretable
def feature_table_list(project: str, labels: str): """ List all feature tables """ feast_client = Client() # type: Client labels_dict = _get_labels_dict(labels) table = [] for ft in feast_client.list_feature_tables(project=project, labels=labels_dict): table.append([ft.name, ft.entities]) from tabulate import tabulate print(tabulate(table, headers=["NAME", "ENTITIES"], tablefmt="plain"))
def test_get_list_basic( client: Client, customer_entity: Entity, driver_entity: Entity, basic_featuretable: FeatureTable, ): # ApplyEntity client.apply_entity(customer_entity) client.apply_entity(driver_entity) # GetEntity Check assert client.get_entity(name="customer_id") == customer_entity assert client.get_entity(name="driver_id") == driver_entity # ListEntities Check common_filtering_labels = {"common_key": "common_val"} matchmaking_filtering_labels = {"team": "matchmaking"} actual_common_entities = client.list_entities( labels=common_filtering_labels) actual_matchmaking_entities = client.list_entities( labels=matchmaking_filtering_labels) assert len(actual_common_entities) == 2 assert len(actual_matchmaking_entities) == 1 # ApplyFeatureTable client.apply_feature_table(basic_featuretable) # GetFeatureTable Check actual_get_feature_table = client.get_feature_table( name="basic_featuretable") assert actual_get_feature_table == basic_featuretable # ListFeatureTables Check actual_list_feature_table = [ ft for ft in client.list_feature_tables() if ft.name == "basic_featuretable" ][0] assert actual_list_feature_table == basic_featuretable
def test_no_auth_sent_when_auth_disabled( self, insecure_core_server_that_blocks_auth): client = Client( core_url=f"localhost:{insecure_core_server_that_blocks_auth}") client.list_feature_tables()