@@ -184,18 +184,6 @@ def registry_test_setup_partially(config_path: str):
184184 client .build_features (anchor_list = [agg_anchor , request_anchor ], derived_feature_list = derived_feature_list )
185185 return client
186186
187- def registry_test_setup_append (config_path : str ):
188- """Append features to a project. Will call `generate_entities()` and register from the 2nd anchor feature
189- """
190-
191- client = FeathrClient (config_path = config_path , project_registry_tag = {"for_test_purpose" :"true" })
192-
193- request_anchor , agg_anchor , derived_feature_list = generate_entities ()
194- agg_anchor .features = agg_anchor .features [1 :]
195- client .build_features (anchor_list = [agg_anchor , request_anchor ], derived_feature_list = derived_feature_list )
196- return client
197-
198-
199187def generate_entities ():
200188 def add_new_dropoff_and_fare_amount_column (df : DataFrame ):
201189 from pyspark .sql .functions import col
@@ -375,6 +363,29 @@ def add_new_dropoff_and_fare_amount_column(df: DataFrame):
375363 client .build_features (anchor_list = [agg_anchor , request_anchor ], derived_feature_list = derived_feature_list )
376364 return client
377365
366+ def registry_test_setup_for_409 (config_path : str , project_name : str ):
367+ now = datetime .now ()
368+ os .environ ["project_config__project_name" ] = project_name
369+
370+ client = FeathrClient (config_path = config_path , project_registry_tag = {"for_test_purpose" :"true" })
371+
372+ # tranform in other sample is cast_float(trip_distance)>30
373+ # update this to trigger 409 conflict with the existing one
374+ features = [
375+ Feature (name = "f_is_long_trip_distance" ,
376+ feature_type = BOOLEAN ,
377+ transform = "cast_float(trip_distance)>10" ),
378+ ]
379+
380+ request_anchor = FeatureAnchor (name = "request_features" ,
381+ source = INPUT_CONTEXT ,
382+ features = features ,
383+ registry_tags = {"for_test_purpose" :"true" }
384+ )
385+
386+ client .build_features (anchor_list = [request_anchor ])
387+ return client
388+
378389def get_online_test_table_name (table_name : str ):
379390 # use different time for testing to avoid write conflicts
380391 now = datetime .now ()
0 commit comments