Upload validate.py with huggingface_hub
Browse files- validate.py +2 -2
validate.py
CHANGED
|
@@ -21,7 +21,7 @@ class ValidateSchema(Validator, StreamInstanceOperator):
|
|
| 21 |
assert self.schema is not None, "Schema must be specified"
|
| 22 |
|
| 23 |
def verify_first_instance(self, instance):
|
| 24 |
-
for std_field in self.
|
| 25 |
assert (
|
| 26 |
std_field in instance
|
| 27 |
), f'Field "{std_field}" is missing in the first instance'
|
|
@@ -47,5 +47,5 @@ class StandardSchema(Features):
|
|
| 47 |
)
|
| 48 |
|
| 49 |
|
| 50 |
-
class
|
| 51 |
schema: Features = field(default_factory=StandardSchema)
|
|
|
|
| 21 |
assert self.schema is not None, "Schema must be specified"
|
| 22 |
|
| 23 |
def verify_first_instance(self, instance):
|
| 24 |
+
for std_field in self.standard_fields:
|
| 25 |
assert (
|
| 26 |
std_field in instance
|
| 27 |
), f'Field "{std_field}" is missing in the first instance'
|
|
|
|
| 47 |
)
|
| 48 |
|
| 49 |
|
| 50 |
+
class ValidateStandardSchema:
|
| 51 |
schema: Features = field(default_factory=StandardSchema)
|