@@ -407,15 +407,12 @@ def _validate_ndjson(lines: Iterable[Dict[str, Any]],
407
407
MALValidationError: Raise for invalid NDJson
408
408
UuidError: Duplicate UUID in upload
409
409
"""
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 }
413
410
feature_schemas = get_mal_schemas (project .ontology ())
414
411
uids : Set [str ] = set ()
415
412
for idx , line in enumerate (lines ):
416
413
try :
417
414
annotation = NDAnnotation (** line )
418
- annotation .validate_instance (data_row_ids , feature_schemas )
415
+ annotation .validate_instance (feature_schemas )
419
416
uuid = str (annotation .uuid )
420
417
if uuid in uids :
421
418
raise labelbox .exceptions .UuidError (
@@ -595,12 +592,6 @@ class NDBase(NDFeatureSchema):
595
592
uuid : UUID
596
593
dataRow : DataRow
597
594
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
-
604
595
def validate_feature_schemas (self , valid_feature_schemas ):
605
596
if self .schemaId not in valid_feature_schemas :
606
597
raise ValueError (
@@ -612,9 +603,8 @@ def validate_feature_schemas(self, valid_feature_schemas):
612
603
f"Schema id { self .schemaId } does not map to the assigned tool { valid_feature_schemas [self .schemaId ]['tool' ]} "
613
604
)
614
605
615
- def validate_instance (self , valid_datarows , valid_feature_schemas ):
606
+ def validate_instance (self , valid_feature_schemas ):
616
607
self .validate_feature_schemas (valid_feature_schemas )
617
- self .validate_datarow (valid_datarows )
618
608
619
609
class Config :
620
610
#Users shouldn't to add extra data to the payload
@@ -694,6 +684,7 @@ class NDBaseTool(NDBase):
694
684
695
685
#This is indepdent of our problem
696
686
def validate_feature_schemas (self , valid_feature_schemas ):
687
+ super (NDBaseTool , self ).validate_feature_schemas (valid_feature_schemas )
697
688
for classification in self .classifications :
698
689
classification .validate_feature_schemas (
699
690
valid_feature_schemas [self .schemaId ]['classifications' ])
0 commit comments