From 075fbd33dbdd0796f67c470c1e64475af63b16ce Mon Sep 17 00:00:00 2001 From: Dawid Bernaciak <68283272+dbernaciak@users.noreply.github.com> Date: Fri, 21 Jun 2024 18:19:11 -0400 Subject: [PATCH] Feature/fix fsync upload (#55) * fix fsync upload --- CHANGELOG.md | 6 +++++- Cargo.lock | 2 +- Cargo.toml | 2 +- py_src/fusion/__init__.py | 2 +- py_src/fusion/fs_sync.py | 2 +- py_src/fusion/utils.py | 5 +++-- pyproject.toml | 4 ++-- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4fa849..b2dd3b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.3] - 2024-06-20 + +* fix fsync upload + ## [1.1.2] - 2024-06-16 * default root_url change @@ -143,4 +147,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.0.1] - 2022-05-12 -* First live release on JPMC gitub \ No newline at end of file +* First live release on JPMC gitub diff --git a/Cargo.lock b/Cargo.lock index 66be951..5ae30a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -103,7 +103,7 @@ dependencies = [ [[package]] name = "pyfusion" -version = "1.1.2" +version = "1.1.3" dependencies = [ "pyo3", ] diff --git a/Cargo.toml b/Cargo.toml index ec8ff5d..704cceb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyfusion" -version = "1.1.2" +version = "1.1.3" edition = "2021" diff --git a/py_src/fusion/__init__.py b/py_src/fusion/__init__.py index b9ad505..9366f29 100644 --- a/py_src/fusion/__init__.py +++ b/py_src/fusion/__init__.py @@ -2,7 +2,7 @@ __author__ = """Fusion Devs""" __email__ = "fusion_developers@jpmorgan.com" -__version__ = "1.1.2" +__version__ = "1.1.3" from fusion.authentication import FusionCredentials from fusion.fs_sync import fsync diff --git a/py_src/fusion/fs_sync.py b/py_src/fusion/fs_sync.py index dfce070..7c22972 100644 --- a/py_src/fusion/fs_sync.py +++ b/py_src/fusion/fs_sync.py @@ -95,7 +95,7 @@ def _upload( local_path: str = "", ) -> list[tuple[bool, str, Optional[str]]]: upload_df = df.rename(columns={"path_local": "path"}) - upload_df["path"] = local_path + upload_df["path"] + upload_df["path"] = [Path(local_path) / p for p in upload_df["path"]] parallel = len(df) > 1 res = upload_files( fs_fusion, diff --git a/py_src/fusion/utils.py b/py_src/fusion/utils.py index c6370d7..abfc691 100644 --- a/py_src/fusion/utils.py +++ b/py_src/fusion/utils.py @@ -61,7 +61,8 @@ class TqdmBatchCompletionCallback(joblib.parallel.BatchCompletionCallBack): # t def __call__(self, *args: Any, **kwargs: Any) -> Any: n = 0 - for i in args[0]._result: + lst = args[0]._result if hasattr(args[0], "_result") else args[0] + for i in lst: try: if i[0] is True: n += 1 @@ -1050,7 +1051,7 @@ def _upload(p_url: str, path: str) -> tuple[bool, str, Optional[str]]: res = [None] * len(loop) if show_progress: with tqdm(total=len(loop)) as p: - for i, row in loop.iterrows(): + for i, (_, row) in enumerate(loop.iterrows()): r = _upload(row["url"], row["path"]) res[i] = r if r[0] is True: diff --git a/pyproject.toml b/pyproject.toml index 410fd3d..e853e51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pyfusion" -version = "1.1.2" +version = "1.1.3" homepage = "https://github.com/jpmorganchase/fusion" description = "JPMC Fusion Developer Tools" @@ -207,7 +207,7 @@ report.fail_under = 60 run.parallel = true [tool.bumpversion] -current_version = "1.1.2" +current_version = "1.1.3" parse = '(?P\d+)\.(?P\d+)\.(?P\d+)(?:-(?P[a-z]+)(?P\d+))?' serialize = [ '{major}.{minor}.{patch}-{release}{candidate}',