@@ -277,12 +277,15 @@ def test_record_with_schema_enforcement(self):
277277 "required" : ["temperature" , "sample_id" ]
278278 })
279279
280- self ._df_api .schemaCreate (
280+ schema_result = self ._df_api .schemaCreate (
281281 "test_rec_schema" ,
282282 definition = schema_def ,
283283 description = "Schema for record integration test" ,
284284 )
285-
285+
286+ schema_id = schema_result [0 ].data [0 ].id # should be "test_rec_schema:1"
287+ schema_id = schema_result [0 ].data [0 ].id
288+ self .assertIn (":" , schema_id , f"Expected versioned schema ID, got: { schema_id } " )
286289 # --- Record create with valid metadata and schema enforce ---
287290 valid_metadata = json .dumps ({
288291 "temperature" : 300.5 ,
@@ -293,7 +296,7 @@ def test_record_with_schema_enforcement(self):
293296 data_result = self ._df_api .dataCreate (
294297 title = "Schema Enforced Record" ,
295298 metadata = valid_metadata ,
296- schema = "test_rec_schema" ,
299+ schema = schema_id ,
297300 schema_enforce = True ,
298301 parent_id = "root" ,
299302 )
@@ -313,7 +316,7 @@ def test_record_with_schema_enforcement(self):
313316 self ._df_api .dataCreate (
314317 title = "Should Fail" ,
315318 metadata = invalid_metadata ,
316- schema = "test_rec_schema" ,
319+ schema = schema_id ,
317320 schema_enforce = True ,
318321 parent_id = "root" ,
319322 )
@@ -322,7 +325,7 @@ def test_record_with_schema_enforcement(self):
322325 warn_result = self ._df_api .dataCreate (
323326 title = "Schema Warn Record" ,
324327 metadata = invalid_metadata ,
325- schema = "test_rec_schema" ,
328+ schema = schema_id ,
326329 parent_id = "root" ,
327330 )
328331
@@ -336,7 +339,7 @@ def test_record_with_schema_enforcement(self):
336339 update_result = self ._df_api .dataUpdate (
337340 rec_id ,
338341 metadata = merge_metadata ,
339- schema = "test_rec_schema" ,
342+ schema = schema_id ,
340343 schema_enforce = True ,
341344 )
342345
@@ -351,21 +354,21 @@ def test_record_with_schema_enforcement(self):
351354 rec_id ,
352355 metadata = incomplete_metadata ,
353356 metadata_set = True ,
354- schema = "test_rec_schema" ,
357+ schema = schema_id ,
355358 schema_enforce = True ,
356359 )
357360
358361 # --- Pre-validate metadata before committing ---
359362 validate_result = self ._df_api .metadataValidate (
360- "test_rec_schema" ,
363+ schema_id ,
361364 metadata = valid_metadata ,
362365 )
363366
364367 # No errors expected
365368 self .assertFalse (validate_result [0 ].errors )
366369
367370 validate_result_bad = self ._df_api .metadataValidate (
368- "test_rec_schema" ,
371+ schema_id ,
369372 metadata = invalid_metadata ,
370373 )
371374
@@ -387,7 +390,7 @@ def test_record_with_schema_enforcement(self):
387390
388391 self .assertEqual (status , 3 )
389392
390- self ._df_api .schemaDelete ("test_rec_schema" )
393+ self ._df_api .schemaDelete (schema_id )
391394
392395
393396if __name__ == "__main__" :
0 commit comments