@@ -53,6 +53,7 @@ def id(self):
5353
5454
5555class _CamelCaseMixin (BaseModel ):
56+
5657 class Config :
5758 allow_population_by_field_name = True
5859 alias_generator = camel_case
@@ -135,14 +136,18 @@ def _build_ontology(self):
135136 f for f in self .fields if f .reserved
136137 ]
137138 self .reserved_by_id = self ._make_id_index (self .reserved_fields )
138- self .reserved_by_name : Dict [str , DataRowMetadataSchema ] = self ._make_name_index (self .reserved_fields )
139+ self .reserved_by_name : Dict [
140+ str ,
141+ DataRowMetadataSchema ] = self ._make_name_index (self .reserved_fields )
139142
140143 # custom fields
141144 self .custom_fields : List [DataRowMetadataSchema ] = [
142145 f for f in self .fields if not f .reserved
143146 ]
144147 self .custom_by_id = self ._make_id_index (self .custom_fields )
145- self .custom_by_name : Dict [str , DataRowMetadataSchema ] = self ._make_name_index (self .custom_fields )
148+ self .custom_by_name : Dict [
149+ str ,
150+ DataRowMetadataSchema ] = self ._make_name_index (self .custom_fields )
146151
147152 @staticmethod
148153 def _make_name_index (fields : List [DataRowMetadataSchema ]):
@@ -158,7 +163,7 @@ def _make_name_index(fields: List[DataRowMetadataSchema]):
158163
159164 @staticmethod
160165 def _make_id_index (
161- fields : List [DataRowMetadataSchema ]
166+ fields : List [DataRowMetadataSchema ]
162167 ) -> Dict [SchemaId , DataRowMetadataSchema ]:
163168 index = {}
164169 for f in fields :
@@ -209,9 +214,9 @@ def _parse_ontology(raw_ontology) -> List[DataRowMetadataSchema]:
209214 return fields
210215
211216 def parse_metadata (
212- self , unparsed : List [Dict [str ,
213- List [Union [str ,
214- Dict ]]]]) -> List [DataRowMetadata ]:
217+ self , unparsed : List [Dict [str ,
218+ List [Union [str ,
219+ Dict ]]]]) -> List [DataRowMetadata ]:
215220 """ Parse metadata responses
216221
217222 >>> mdo.parse_metadata([metdata])
@@ -272,7 +277,7 @@ def bulk_upsert(
272277 raise ValueError ("Empty list passed" )
273278
274279 def _batch_upsert (
275- upserts : List [_UpsertBatchDataRowMetadata ]
280+ upserts : List [_UpsertBatchDataRowMetadata ]
276281 ) -> List [DataRowMetadataBatchResponse ]:
277282 query = """mutation UpsertDataRowMetadataBetaPyApi($metadata: [DataRowCustomMetadataBatchUpsertInput!]!) {
278283 upsertDataRowCustomMetadata(data: $metadata){
@@ -305,13 +310,13 @@ def _batch_upsert(
305310 fields = list (
306311 chain .from_iterable (
307312 self ._parse_upsert (m ) for m in m .fields ))).dict (
308- by_alias = True ))
313+ by_alias = True ))
309314
310315 res = _batch_operations (_batch_upsert , items , self ._batch_size )
311316 return res
312317
313318 def bulk_delete (
314- self , deletes : List [DeleteDataRowMetadata ]
319+ self , deletes : List [DeleteDataRowMetadata ]
315320 ) -> List [DataRowMetadataBatchResponse ]:
316321 """ Delete metadata from a datarow by specifiying the fields you want to remove
317322
@@ -338,7 +343,7 @@ def bulk_delete(
338343 raise ValueError ("Empty list passed" )
339344
340345 def _batch_delete (
341- deletes : List [_DeleteBatchDataRowMetadata ]
346+ deletes : List [_DeleteBatchDataRowMetadata ]
342347 ) -> List [DataRowMetadataBatchResponse ]:
343348 query = """mutation DeleteDataRowMetadataBetaPyApi($deletes: [DataRowCustomMetadataBatchDeleteInput!]!) {
344349 deleteDataRowCustomMetadata(data: $deletes) {
@@ -459,9 +464,9 @@ def _batch_items(iterable: List[Any], size: int) -> Generator[Any, None, None]:
459464
460465
461466def _batch_operations (
462- batch_function : _BatchFunction ,
463- items : List ,
464- batch_size : int = 100 ,
467+ batch_function : _BatchFunction ,
468+ items : List ,
469+ batch_size : int = 100 ,
465470):
466471 response = []
467472
0 commit comments