@@ -151,9 +151,8 @@ def labels(self, datasets=None, order_by=None):
151
151
id_param , id_param , where , order_by_str ,
152
152
query .results_query_part (Label ))
153
153
154
- return PaginatedCollection (self .client , query_str ,
155
- {id_param : self .uid }, ["project" , "labels" ],
156
- Label )
154
+ return PaginatedCollection (self .client , query_str , {id_param : self .uid },
155
+ ["project" , "labels" ], Label )
157
156
158
157
def export_queued_data_rows (self , timeout_seconds = 120 ):
159
158
""" Returns all data rows that are currently enqueued for this project.
@@ -394,13 +393,11 @@ def create_labeler_performance(client, result):
394
393
# python isoformat doesn't accept Z as utc timezone
395
394
result ["lastActivityTime" ] = datetime .fromisoformat (
396
395
result ["lastActivityTime" ].replace ('Z' , '+00:00' ))
397
- return LabelerPerformance (** {
398
- utils .snake_case (key ): value
399
- for key , value in result .items ()
400
- })
396
+ return LabelerPerformance (
397
+ **
398
+ {utils .snake_case (key ): value for key , value in result .items ()})
401
399
402
- return PaginatedCollection (self .client , query_str ,
403
- {id_param : self .uid },
400
+ return PaginatedCollection (self .client , query_str , {id_param : self .uid },
404
401
["project" , "labelerPerformance" ],
405
402
create_labeler_performance )
406
403
@@ -412,7 +409,7 @@ def review_metrics(self, net_score):
412
409
Returns:
413
410
int, aggregation count of reviews for given `net_score`.
414
411
"""
415
- if net_score not in (None , ) + tuple (Entity .Review .NetScore ):
412
+ if net_score not in (None ,) + tuple (Entity .Review .NetScore ):
416
413
raise InvalidQueryError (
417
414
"Review metrics net score must be either None "
418
415
"or one of Review.NetScore values" )
@@ -634,8 +631,8 @@ def unset_labeling_parameter_overrides(self, data_rows):
634
631
query_str = """mutation UnsetLabelingParameterOverridesPyApi($%s: ID!){
635
632
project(where: { id: $%s}) {
636
633
unsetLabelingParameterOverrides(data: [%s]) { success }}}""" % (
637
- id_param , id_param , ",\n " .join ("{dataRowId: \" %s \" }" % row . uid
638
- for row in data_rows ))
634
+ id_param , id_param , ",\n " .join (
635
+ "{dataRowId: \" %s \" }" % row . uid for row in data_rows ))
639
636
res = self .client .execute (query_str , {id_param : self .uid })
640
637
return res ["project" ]["unsetLabelingParameterOverrides" ]["success" ]
641
638
0 commit comments