@@ -352,3 +352,48 @@ def test_validate_document_annotation_wrong_class_id(self):
352352 sa .validate_annotations ("Document" , os .path .join (self .vector_folder_path , f"{ tmpdir_name } /test_validate_document_annotation_wrong_class_id.json" ))
353353 self .assertIn ("instances[0].classIdintegertypeexpected" , out .getvalue ().strip ().replace (" " , "" ))
354354
355+
356+ def test_validate_document_annotation_with_null_created_at (self ):
357+ with tempfile .TemporaryDirectory () as tmpdir_name :
358+ with open (f"{ tmpdir_name } /test_validate_document_annotation_with_null_created_at.json" , "w" ) as test_validate_document_annotation_with_null_created_at :
359+ test_validate_document_annotation_with_null_created_at .write (
360+ '''
361+ {
362+ "metadata": {
363+ "name": "text_file_example_1",
364+ "status": "NotStarted",
365+ "url": "https://sa-public-files.s3.us-west-2.amazonaws.com/Text+project/text_file_example_1.txt",
366+ "projectId": 167826,
367+ "annotatorEmail": null,
368+ "qaEmail": null,
369+ "lastAction": {
370+ "email": "some.email@gmail.com",
371+ "timestamp": 1636620976450
372+ }
373+ },
374+ "instances": [{
375+ "start": 253,
376+ "end": 593,
377+ "classId": 1,
378+ "createdAt": null,
379+ "createdBy": {
380+ "email": "some.email@gmail.com",
381+ "role": "Admin"
382+ },
383+ "updatedAt": null,
384+ "updatedBy": {
385+ "email": "some.email@gmail.com",
386+ "role": "Admin"
387+ },
388+ "attributes": [],
389+ "creationType": "Manual",
390+ "className": "vid"
391+ }],
392+ "tags": [],
393+ "freeText": ""
394+ }
395+ '''
396+ )
397+ self .assertTrue (sa .validate_annotations ("Document" , os .path .join (self .vector_folder_path ,
398+ f"{ tmpdir_name } /test_validate_document_annotation_with_null_created_at.json" )))
399+
0 commit comments