@@ -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 (
@@ -427,6 +424,7 @@ def _validate_ndjson(lines: Iterable[Dict[str, Any]],
427
424
f"Invalid NDJson on line { idx } " ) from e
428
425
429
426
427
+
430
428
#The rest of this file contains objects for MAL validation
431
429
def parse_classification (tool ):
432
430
"""
@@ -595,12 +593,6 @@ class NDBase(NDFeatureSchema):
595
593
uuid : UUID
596
594
dataRow : DataRow
597
595
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
596
def validate_feature_schemas (self , valid_feature_schemas ):
605
597
if self .schemaId not in valid_feature_schemas :
606
598
raise ValueError (
@@ -612,9 +604,8 @@ def validate_feature_schemas(self, valid_feature_schemas):
612
604
f"Schema id { self .schemaId } does not map to the assigned tool { valid_feature_schemas [self .schemaId ]['tool' ]} "
613
605
)
614
606
615
- def validate_instance (self , valid_datarows , valid_feature_schemas ):
607
+ def validate_instance (self , valid_feature_schemas ):
616
608
self .validate_feature_schemas (valid_feature_schemas )
617
- self .validate_datarow (valid_datarows )
618
609
619
610
class Config :
620
611
#Users shouldn't to add extra data to the payload
@@ -694,6 +685,7 @@ class NDBaseTool(NDBase):
694
685
695
686
#This is indepdent of our problem
696
687
def validate_feature_schemas (self , valid_feature_schemas ):
688
+ super (NDBaseTool , self ).validate_feature_schemas (valid_feature_schemas )
697
689
for classification in self .classifications :
698
690
classification .validate_feature_schemas (
699
691
valid_feature_schemas [self .schemaId ]['classifications' ])
0 commit comments