File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/phoenix/server/api/routers/v1 Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,25 @@ async def create_experiment(
182
182
project_name = project_name ,
183
183
user_id = user_id ,
184
184
)
185
+
186
+ resolved_split_ids = []
187
+ for split_id_str in request_body .split_ids :
188
+ split_gid = GlobalID .from_id (split_id_str )
189
+ if split_gid .type_name != "DatasetSplit" :
190
+ raise HTTPException (
191
+ detail = f"ID { split_gid } is not a DatasetSplit" ,
192
+ status_code = HTTP_422_UNPROCESSABLE_ENTITY ,
193
+ )
194
+ resolved_split_ids .append (int (split_gid .node_id ))
195
+ # generate experiment dataset splits relation
196
+ # prior to the crosswalk table insert
197
+ # in insert_experiment_with_examples_snapshot
198
+ experiment .experiment_dataset_splits = [
199
+ models .ExperimentDatasetSplit (dataset_split_id = dataset_split_id )
200
+ for dataset_split_id in resolved_split_ids
201
+ ]
202
+
203
+ # crosswalk table assumes the relation is already present
185
204
await insert_experiment_with_examples_snapshot (session , experiment )
186
205
187
206
dialect = SupportedSQLDialect (session .bind .dialect .name )
You can’t perform that action at this time.
0 commit comments