@@ -260,17 +260,20 @@ def validator(self):
260
260
261
261
262
262
class FieldValidator (SDBaseValidator ):
263
- def __init__ (self , dictionary_field ):
263
+ def __init__ (self , data_field ):
264
264
"""
265
265
Parameters:
266
- dictionary_field(dict) -- A dict field
266
+ data_field -- A dict or list of fields
267
267
"""
268
- super (FieldValidator , self ).__init__ (dictionary_field )
269
- self ._valid_type_fields = [
270
- "unique-id" , "boolean" , "string" , "integer" , "decimal" ,
271
- "enumerated" , "date" , "integer-time-series" ,
272
- "decimal-time-series" , "string-time-series"
273
- ]
268
+ if not isinstance (data_field , list ):
269
+ data_field = [data_field ]
270
+ for dictionary_field in data_field :
271
+ super (FieldValidator , self ).__init__ (dictionary_field )
272
+ self ._valid_type_fields = [
273
+ "unique-id" , "boolean" , "string" , "integer" , "decimal" ,
274
+ "enumerated" , "date" , "integer-time-series" ,
275
+ "decimal-time-series" , "string-time-series"
276
+ ]
274
277
275
278
def _validate_name (self ):
276
279
"""Validate field name"""
0 commit comments