Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernaciak committed Dec 1, 2023
1 parent 367d1d5 commit a27bb3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions fusion/fusion_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ async def _ls_real(self, url, detail=True, **kwargs):
is_file = False
size = None
try:
async with session.head(url + "/operationType/download", **self.kwargs) as r:
async with session.head(
url + "/operationType/download", **self.kwargs
) as r:
self._raise_not_found_for_status(r, url)
out = [
url.split("/")[6]
Expand All @@ -125,6 +127,7 @@ async def _ls_real(self, url, detail=True, **kwargs):
size = int(r.headers["Content-Length"])
is_file = True
except Exception as _:
logger.debug("Not a file - " + _)
async with session.get(url, **self.kwargs) as r:
self._raise_not_found_for_status(r, url)
out = await r.json()
Expand Down Expand Up @@ -353,7 +356,6 @@ async def put_data():

@staticmethod
def _construct_headers(file_local, dt_iso, chunk_size=5 * 2**20, multipart=False):

headers = {
"Content-Type": "application/octet-stream",
"x-jpmc-distribution-created-date": dt_iso,
Expand Down
7 changes: 5 additions & 2 deletions fusion/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def tqdm_joblib(tqdm_object):
"""

class TqdmBatchCompletionCallback(joblib.parallel.BatchCompletionCallBack):
""" Tqdm execution wrapper."""
"""Tqdm execution wrapper."""

def __call__(self, *args, **kwargs):
n = 0
for i in args[0]._result:
Expand Down Expand Up @@ -906,7 +907,9 @@ def _upload(row):
delayed(_upload)(row) for index, row in loop.iterrows()
)
else:
res = Parallel(n_jobs=n_par)(delayed(_upload)(row) for index, row in loop.iterrows())
res = Parallel(n_jobs=n_par)(
delayed(_upload)(row) for index, row in loop.iterrows()
)
else:
if show_progress:
with tqdm_joblib(tqdm(total=len(loop.iterrows()))) as _:
Expand Down

0 comments on commit a27bb3d

Please sign in to comment.