@@ -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 (
@@ -595,12 +592,6 @@ class NDBase(NDFeatureSchema):
595592 uuid : UUID
596593 dataRow : DataRow
597594
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-
604595 def validate_feature_schemas (self , valid_feature_schemas ):
605596 if self .schemaId not in valid_feature_schemas :
606597 raise ValueError (
@@ -612,9 +603,8 @@ def validate_feature_schemas(self, valid_feature_schemas):
612603 f"Schema id { self .schemaId } does not map to the assigned tool { valid_feature_schemas [self .schemaId ]['tool' ]} "
613604 )
614605
615- def validate_instance (self , valid_datarows , valid_feature_schemas ):
606+ def validate_instance (self , valid_feature_schemas ):
616607 self .validate_feature_schemas (valid_feature_schemas )
617- self .validate_datarow (valid_datarows )
618608
619609 class Config :
620610 #Users shouldn't to add extra data to the payload
@@ -694,6 +684,7 @@ class NDBaseTool(NDBase):
694684
695685 #This is indepdent of our problem
696686 def validate_feature_schemas (self , valid_feature_schemas ):
687+ super (NDBaseTool , self ).validate_feature_schemas (valid_feature_schemas )
697688 for classification in self .classifications :
698689 classification .validate_feature_schemas (
699690 valid_feature_schemas [self .schemaId ]['classifications' ])
0 commit comments