@@ -407,15 +407,12 @@ def _validate_ndjson(lines: Iterable[Dict[str, Any]],
407407 MALValidationError: Raise for invalid NDJson
408408 UuidError: Duplicate UUID in upload
409409 """
410- export_url = project .export_queued_data_rows ()
411- data_row_json = ndjson .loads (requests .get (export_url ).text )
412- data_row_ids = {row ['id' ] for row in data_row_json }
413410 feature_schemas = get_mal_schemas (project .ontology ())
414411 uids : Set [str ] = set ()
415412 for idx , line in enumerate (lines ):
416413 try :
417414 annotation = NDAnnotation (** line )
418- annotation .validate_instance (data_row_ids , feature_schemas )
415+ annotation .validate_instance (feature_schemas )
419416 uuid = str (annotation .uuid )
420417 if uuid in uids :
421418 raise labelbox .exceptions .UuidError (
@@ -427,6 +424,7 @@ def _validate_ndjson(lines: Iterable[Dict[str, Any]],
427424 f"Invalid NDJson on line { idx } " ) from e
428425
429426
427+
430428#The rest of this file contains objects for MAL validation
431429def parse_classification (tool ):
432430 """
@@ -595,12 +593,6 @@ class NDBase(NDFeatureSchema):
595593 uuid : UUID
596594 dataRow : DataRow
597595
598- def validate_datarow (self , valid_datarows ):
599- if self .dataRow .id not in valid_datarows :
600- raise ValueError (
601- f"datarow { self .dataRow .id } is not attached to the specified project"
602- )
603-
604596 def validate_feature_schemas (self , valid_feature_schemas ):
605597 if self .schemaId not in valid_feature_schemas :
606598 raise ValueError (
@@ -612,9 +604,8 @@ def validate_feature_schemas(self, valid_feature_schemas):
612604 f"Schema id { self .schemaId } does not map to the assigned tool { valid_feature_schemas [self .schemaId ]['tool' ]} "
613605 )
614606
615- def validate_instance (self , valid_datarows , valid_feature_schemas ):
607+ def validate_instance (self , valid_feature_schemas ):
616608 self .validate_feature_schemas (valid_feature_schemas )
617- self .validate_datarow (valid_datarows )
618609
619610 class Config :
620611 #Users shouldn't to add extra data to the payload
@@ -694,6 +685,7 @@ class NDBaseTool(NDBase):
694685
695686 #This is indepdent of our problem
696687 def validate_feature_schemas (self , valid_feature_schemas ):
688+ super (NDBaseTool , self ).validate_feature_schemas (valid_feature_schemas )
697689 for classification in self .classifications :
698690 classification .validate_feature_schemas (
699691 valid_feature_schemas [self .schemaId ]['classifications' ])
0 commit comments