[jb] Style fix on the query API module
@@ -81,7 +81,11 @@ class QueryApi(Api):
'progress': job['progress'],
'isRunning': job['start_time'] > job['end_time'],
'canWrite': job in jobs['in_flight_queries'],
- 'duration': self._time_in_ms_groups(re.search(r"\s*(([\d.]*)([a-z]*))(([\d.]*)([a-z]*))?(([\d.]*)([a-z]*))?", job['duration'], re.MULTILINE).groups()),
+ 'duration': self._time_in_ms_groups(
+ re.search(r"\s*(([\d.]*)([a-z]*))(([\d.]*)([a-z]*))?(([\d.]*)([a-z]*))?",
+ job['duration'],
+ re.MULTILINE
+ ).groups()),
'submitted': job['start_time'],
# Extra specific
'rows_fetched': job['rows_fetched'],
@@ -129,7 +133,9 @@ class QueryApi(Api):
app = apps.get('apps')[0]
progress_groups = re.search(r"([\d\.\,]+)%", app.get('progress'))
app.update({
- 'progress': float(progress_groups.group(1)) if progress_groups and progress_groups.group(1) else 100 if self._api_status(app.get('status')) in ['SUCCEEDED', 'FAILED'] else 1,
+ 'progress': float(progress_groups.group(1)) \
+ if progress_groups and progress_groups.group(1) else 100 \
+ if self._api_status(app.get('status')) in ['SUCCEEDED', 'FAILED'] else 1,
'type': 'queries',
'doc_url': "%s/query_plan?query_id=%s" % (self.api.url, appid),
'properties': {
@@ -303,7 +309,10 @@ class QueryApi(Api):
time_filter = filters.get("time")
period_ms = self._time_in_ms(float(time_filter.get("time_value")), time_filter.get("time_unit")[0:1])
current_ms = time.time() * 1000.0
- filter_list.append(lambda app: current_ms - (time.mktime(datetime.strptime(app['start_time'][:26], '%Y-%m-%d %H:%M:%S.%f').timetuple()) * 1000) < period_ms)
+ filter_list.append(
+ lambda app: current_ms - (time.mktime(datetime.strptime(app['start_time'][:26], '%Y-%m-%d %H:%M:%S.%f').timetuple()) * 1000)
+ < period_ms
+ )
if filters.get("states"):
filter_list.append(lambda app: self._api_status_filter(app['state']).lower() in filters.get("states"))
