diff --git a/feathr_project/feathr/client.py b/feathr_project/feathr/client.py index bb78f7f74..23e7e6691 100644 --- a/feathr_project/feathr/client.py +++ b/feathr_project/feathr/client.py @@ -188,6 +188,7 @@ def __init__(self, config_path:str = "./feathr_config.yaml", local_workspace_dir registry_delimiter = self.envutils.get_environment_variable_with_default('feature_registry', 'purview', 'delimiter') # initialize the registry no matter whether we set purview name or not, given some of the methods are used there. self.registry = _PurviewRegistry(self.project_name, azure_purview_name, registry_delimiter, project_registry_tag, config_path = config_path, credential=credential) + logger.warning("FEATURE_REGISTRY__PURVIEW__PURVIEW_NAME will be deprecated soon. Please use FEATURE_REGISTRY__API_ENDPOINT instead.") else: # no registry configured logger.info("Feathr registry is not configured. Consider setting the Feathr registry component for richer feature store experience.") diff --git a/feathr_project/test/test_feature_registry.py b/feathr_project/test/test_feature_registry.py index 86db93440..9fe66322a 100644 --- a/feathr_project/test/test_feature_registry.py +++ b/feathr_project/test/test_feature_registry.py @@ -14,7 +14,7 @@ from feathr.registry._feathr_registry_client import _FeatureRegistry from feathrcli.cli import init from test_fixture import registry_test_setup -from test_fixture import registry_test_setup_append, registry_test_setup_partially +from test_fixture import registry_test_setup_append, registry_test_setup_partially, registry_test_setup_for_409 from test_utils.constants import Constants class FeatureRegistryTests(unittest.TestCase): @@ -58,6 +58,15 @@ def test_feathr_register_features_e2e(self): # Sync workspace from registry, will get all conf files back client.get_features_from_registry(client.project_name) + + # Register the same feature with different definition and expect an error. + client: FeathrClient = registry_test_setup_for_409(os.path.join(test_workspace_dir, config_path), client.project_name) + + with pytest.raises(RuntimeError) as exc_info: + client.register_features() + + # 30 + # update this to trigger 409 conflict with the existing one + features = [ + Feature(name="f_is_long_trip_distance", + feature_type=BOOLEAN, + transform="cast_float(trip_distance)>10"), + ] + + request_anchor = FeatureAnchor(name="request_features", + source=INPUT_CONTEXT, + features=features, + registry_tags={"for_test_purpose":"true"} + ) + + client.build_features(anchor_list=[request_anchor]) + return client + def get_online_test_table_name(table_name: str): # use different time for testing to avoid write conflicts now = datetime.now()