File tree Expand file tree Collapse file tree 4 files changed +66
-2
lines changed
azure/ai/ml/entities/_feature_set Expand file tree Collapse file tree 4 files changed +66
-2
lines changed Original file line number Diff line number Diff line change @@ -47,15 +47,16 @@ def __init__(
47
47
target = ErrorTarget .FEATURE_SET ,
48
48
error_category = ErrorCategory .USER_ERROR ,
49
49
)
50
- if timestamp_column :
51
- msg = f"Cannot provide timestamp_column for { type } feature source."
50
+ if timestamp_column or source_delay or source_process_code :
51
+ msg = f"Cannot provide timestamp_column/source_delay/source_process_code for { type } feature source."
52
52
raise ValidationException (
53
53
message = msg ,
54
54
no_personal_data_message = msg ,
55
55
error_type = ValidationErrorType .INVALID_VALUE ,
56
56
target = ErrorTarget .FEATURE_SET ,
57
57
error_category = ErrorCategory .USER_ERROR ,
58
58
)
59
+
59
60
if not (path and not dict and not source_process_code ):
60
61
msg = f"Cannot provide source_process_code or kwargs for { type } feature source."
61
62
raise ValidationException (
Original file line number Diff line number Diff line change @@ -91,3 +91,15 @@ def test_feature_set_spec_load_failure(self) -> None:
91
91
featureset_spec_yaml_path = Path (spec_path , "FeatureSetSpec.yaml" )
92
92
with pytest .raises (ValidationException ):
93
93
FeaturesetSpecMetadata ._load (featureset_spec_contents , featureset_spec_yaml_path )
94
+
95
+ spec_path = "./tests/test_configs/feature_set/invalid_spec8"
96
+ featureset_spec_contents = read_feature_set_metadata (path = spec_path )
97
+ featureset_spec_yaml_path = Path (spec_path , "FeatureSetSpec.yaml" )
98
+ with pytest .raises (ValidationException ):
99
+ FeaturesetSpecMetadata ._load (featureset_spec_contents , featureset_spec_yaml_path )
100
+
101
+ spec_path = "./tests/test_configs/feature_set/invalid_spec9"
102
+ featureset_spec_contents = read_feature_set_metadata (path = spec_path )
103
+ featureset_spec_yaml_path = Path (spec_path , "FeatureSetSpec.yaml" )
104
+ with pytest .raises (ValidationException ):
105
+ FeaturesetSpecMetadata ._load (featureset_spec_contents , featureset_spec_yaml_path )
Original file line number Diff line number Diff line change
1
+ # source_delay is not supported for featureset feature source
2
+ source :
3
+ type : featureset
4
+ path : azureml://subscriptions/my_sub/resourcegroups/my_rg/workspaces/my_fs/feturesets/source_feature_set_name/versions/version1
5
+ source_delay :
6
+ days : 2
7
+ hours : 0
8
+ minutes : 0
9
+ feature_transformation_code :
10
+ path : ./code
11
+ transformer_class : driver_hourly_transform.DriverHourlyTransformer
12
+ features :
13
+ - name : conv_rate
14
+ type : double
15
+ - name : acc_rate
16
+ type : double
17
+ - name : avg_daily_trips
18
+ type : double
19
+ source_lookback :
20
+ days : 30
21
+ hours : 0
22
+ minutes : 0
23
+ temporal_join_lookback :
24
+ days : 2
25
+ hours : 0
26
+ minutes : 0
Original file line number Diff line number Diff line change
1
+ # source_process_code is not supported for featureset feature source
2
+ source :
3
+ type : featureset
4
+ path : azureml://subscriptions/my_sub/resourcegroups/my_rg/workspaces/my_fs/feturesets/source_feature_set_name/versions/version1
5
+ source_process_code :
6
+ path : ./source_process_code
7
+ process_class : source_process.MyDataSourceLoader
8
+ feature_transformation_code :
9
+ path : ./code
10
+ transformer_class : driver_hourly_transform.DriverHourlyTransformer
11
+ features :
12
+ - name : conv_rate
13
+ type : double
14
+ - name : acc_rate
15
+ type : double
16
+ - name : avg_daily_trips
17
+ type : double
18
+ source_lookback :
19
+ days : 30
20
+ hours : 0
21
+ minutes : 0
22
+ temporal_join_lookback :
23
+ days : 2
24
+ hours : 0
25
+ minutes : 0
You can’t perform that action at this time.
0 commit comments