more formatting fixes

Found by flake8.
This commit is contained in:
Sarah Hoffmann
2021-07-12 17:45:42 +02:00
parent b4fec57b6d
commit cf98cff2a1
21 changed files with 62 additions and 53 deletions

View File

@@ -203,7 +203,7 @@ class Indexer:
# And insert the curent batch
for idx in range(0, len(places), batch):
part = places[idx:idx+batch]
part = places[idx:idx + batch]
LOG.debug("Processing places: %s", str(part))
runner.index_places(pool.next_free_worker(), part)
progress.add(len(part))

View File

@@ -63,7 +63,7 @@ class ProgressLogger:
places_per_sec = self.done_places
else:
diff_seconds = (rank_end_time - self.rank_start_time).total_seconds()
places_per_sec = self.done_places/diff_seconds
places_per_sec = self.done_places / diff_seconds
LOG.warning("Done %d/%d in %d @ %.3f per second - FINISHED %s\n",
self.done_places, self.total_places, int(diff_seconds),

View File

@@ -25,7 +25,7 @@ class AbstractPlacexRunner:
SET indexed_status = 0, address = v.addr, token_info = v.ti
FROM (VALUES {}) as v(id, addr, ti)
WHERE place_id = v.id
""".format(','.join(["(%s, %s::hstore, %s::jsonb)"] * num_places))
""".format(','.join(["(%s, %s::hstore, %s::jsonb)"] * num_places))
@staticmethod
@@ -124,7 +124,7 @@ class InterpolationRunner:
SET indexed_status = 0, address = v.addr, token_info = v.ti
FROM (VALUES {}) as v(id, addr, ti)
WHERE place_id = v.id
""".format(','.join(["(%s, %s::hstore, %s::jsonb)"] * num_places))
""".format(','.join(["(%s, %s::hstore, %s::jsonb)"] * num_places))
def index_places(self, worker, places):