From 94b45f4aad21fa33fe231baf617db4c30e681923 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 14:27:37 +0200 Subject: [PATCH 01/13] Redis-py 4.5 and Python 3.11 --- .github/workflows/integration.yml | 4 ++-- pyproject.toml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 78001fe..bf73e21 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -56,7 +56,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true strategy: matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] name: Test Python ${{matrix.python-version}} steps: - uses: actions/checkout@v3 @@ -87,4 +87,4 @@ jobs: uses: codecov/codecov-action@v2 with: fail_ci_if_error: false - token: ${{ secrets.CODECOVTOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOVTOKEN }} diff --git a/pyproject.toml b/pyproject.toml index b598872..be00f2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisgraph-bulk-loader" -version = "0.11.0" +version = "0.11.1" description = "RedisGraph Bulk Import Tool" authors = ["Redis Inc "] license = "BSD-3-Clause" @@ -15,6 +15,7 @@ classifiers = [ 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'License :: OSI Approved :: BSD License', 'Development Status :: 5 - Production/Stable' @@ -32,7 +33,7 @@ repository = "https://github.com/RedisGraph/redisgraph-bulk-loader" [tool.poetry.dependencies] python = "^3.6.5" click = "^8.0.1" -redis = "^4.3.4" +redis = "^4.5.1" pathos = "^0.2.8" [tool.poetry.dev-dependencies] From 7c0b150e5af6c30ad7f513bf199990fc49656309 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 14:32:41 +0200 Subject: [PATCH 02/13] fixes 1 --- .github/workflows/integration.yml | 7 +++++-- .github/workflows/publish-pypi.yml | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index bf73e21..f1e62be 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -56,7 +56,9 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true strategy: matrix: + platform: ['ubuntu-20.04', 'macos-11'] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] + fail-fast: false name: Test Python ${{matrix.python-version}} steps: - uses: actions/checkout@v3 @@ -65,7 +67,7 @@ jobs: with: python-version: ${{matrix.python-version}} - name: Cache paths - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | .tox @@ -84,7 +86,8 @@ jobs: - name: run tests run: tox -e cover - name: Upload coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 + if: matrix.python_version == '3.9' && matrix.platform != 'macos-11' with: fail_ci_if_error: false token: ${{ secrets.CODECOVTOKEN }} diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 94e767f..e60cdd9 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -27,7 +27,7 @@ jobs: value: "${{ steps.get_version.outputs.VERSION }}" - name: Set up Python 3.8 - uses: actions/setup-python@v1 + uses: actions/setup-python@v3 with: python-version: 3.8 @@ -35,7 +35,7 @@ jobs: uses: dschep/install-poetry-action@v1.3 - name: Cache Poetry virtualenv - uses: actions/cache@v1 + uses: actions/cache@v3 id: cache with: path: ~/.virtualenvs From f6300a2f1bcfe09c1dbd6d45ff9c144ca4fdc0b6 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 14:35:57 +0200 Subject: [PATCH 03/13] fixes 2 --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index f1e62be..78635f9 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -87,7 +87,7 @@ jobs: run: tox -e cover - name: Upload coverage uses: codecov/codecov-action@v3 - if: matrix.python_version == '3.9' && matrix.platform != 'macos-11' + if: matrix.python-version == '3.9' && matrix.platform != 'macos-11' with: fail_ci_if_error: false token: ${{ secrets.CODECOVTOKEN }} From 27c2abca399c456440e9cf864e91ab8182988e77 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 14:45:26 +0200 Subject: [PATCH 04/13] fixes 3 --- .github/workflows/integration.yml | 40 ++++++++++++++++--------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 78635f9..be1eccf 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -38,9 +38,9 @@ jobs: ~/.virtualenvs ~/.cache/pip ~/.cache/pypoetry - key: lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}} + key: lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python}} restore-keys: | - lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}} + lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python}} - name: prepare the environment run: | @@ -51,32 +51,34 @@ jobs: run: tox -e linters tests: - runs-on: ubuntu-latest + name: Test on ${{ matrix.platform }} with Python ${{ matrix.python }} + runs-on: ${{ matrix.platform }} env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true strategy: matrix: platform: ['ubuntu-20.04', 'macos-11'] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] fail-fast: false - name: Test Python ${{matrix.python-version}} steps: - uses: actions/checkout@v3 - - name: install base python + - name: Setup Python uses: actions/setup-python@v4 with: - python-version: ${{matrix.python-version}} - - name: Cache paths - uses: actions/cache@v3 - with: - path: | - .tox - ~/.virtualenvs - ~/.cache/pip - ~/.cache/pypoetry - key: cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}} - restore-keys: | - cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}} + python-version: ${{matrix.python}} + architecture: x64 + +# - name: Cache paths +# uses: actions/cache@v3 +# with: +# path: | +# .tox +# ~/.virtualenvs +# ~/.cache/pip +# ~/.cache/pypoetry +# key: cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python}} +# restore-keys: | +# cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python}} - name: prepare the environment run: | @@ -87,7 +89,7 @@ jobs: run: tox -e cover - name: Upload coverage uses: codecov/codecov-action@v3 - if: matrix.python-version == '3.9' && matrix.platform != 'macos-11' + if: matrix.python == '3.9' && matrix.platform != 'macos-11' with: fail_ci_if_error: false token: ${{ secrets.CODECOVTOKEN }} From 51c77796a3969dd7e8bc9a9c5d753877943afd9f Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 14:50:01 +0200 Subject: [PATCH 05/13] fixes 4 --- .github/workflows/integration.yml | 2 +- pyproject.toml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index be1eccf..64213a3 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -58,7 +58,7 @@ jobs: strategy: matrix: platform: ['ubuntu-20.04', 'macos-11'] - python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11'] fail-fast: false steps: - uses: actions/checkout@v3 diff --git a/pyproject.toml b/pyproject.toml index be00f2a..541456c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,6 @@ classifiers = [ 'Topic :: Database', 'Programming Language :: Python', 'Intended Audience :: Developers', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', @@ -31,7 +30,7 @@ url = "https://redisgraph.io" repository = "https://github.com/RedisGraph/redisgraph-bulk-loader" [tool.poetry.dependencies] -python = "^3.6.5" +python = ">= 3.7.0" click = "^8.0.1" redis = "^4.5.1" pathos = "^0.2.8" From 78cd442b8a0567e568dfe97864ab63d8ee9c1d72 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 14:54:02 +0200 Subject: [PATCH 06/13] fixes 5 --- .github/workflows/publish-pypi.yml | 4 ++-- pyproject.toml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index e60cdd9..24c933b 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -26,10 +26,10 @@ jobs: key: "tool.poetry.version" value: "${{ steps.get_version.outputs.VERSION }}" - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.9 - name: Install Poetry uses: dschep/install-poetry-action@v1.3 diff --git a/pyproject.toml b/pyproject.toml index 541456c..efdc2ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisgraph-bulk-loader" -version = "0.11.1" +version = "0.12.0" description = "RedisGraph Bulk Import Tool" authors = ["Redis Inc "] license = "BSD-3-Clause" @@ -32,7 +32,8 @@ repository = "https://github.com/RedisGraph/redisgraph-bulk-loader" [tool.poetry.dependencies] python = ">= 3.7.0" click = "^8.0.1" -redis = "^4.5.1" +# redis = "^4.5.1" +redis = "^4.3.4" pathos = "^0.2.8" [tool.poetry.dev-dependencies] From ad9ca5a3b8b051540ece495021fdf41216ee5eb9 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 15:01:36 +0200 Subject: [PATCH 07/13] fixes 6 --- .github/workflows/integration.yml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 64213a3..9c34565 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -80,12 +80,12 @@ jobs: # restore-keys: | # cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python}} - - name: prepare the environment + - name: Prepare environment run: | pip install -U setuptools pip poetry tox-docker tox-poetry poetry config virtualenvs.create false poetry install - - name: run tests + - name: Run tests run: tox -e cover - name: Upload coverage uses: codecov/codecov-action@v3 diff --git a/pyproject.toml b/pyproject.toml index efdc2ed..d4a709a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ repository = "https://github.com/RedisGraph/redisgraph-bulk-loader" python = ">= 3.7.0" click = "^8.0.1" # redis = "^4.5.1" -redis = "^4.3.4" +redis = "~= 4.3.4" pathos = "^0.2.8" [tool.poetry.dev-dependencies] From 58602c7ab711d101983da6f325414dc20929e0e6 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 15:06:57 +0200 Subject: [PATCH 08/13] fixes 7 --- .github/workflows/integration.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9c34565..7e358b3 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -30,18 +30,6 @@ jobs: with: python-version: ${{env.basepython}} - - name: Cache paths - uses: actions/cache@v2 - with: - path: | - .tox - ~/.virtualenvs - ~/.cache/pip - ~/.cache/pypoetry - key: lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python}} - restore-keys: | - lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python}} - - name: prepare the environment run: | pip install -U setuptools pip poetry tox-docker tox-poetry @@ -68,18 +56,6 @@ jobs: python-version: ${{matrix.python}} architecture: x64 -# - name: Cache paths -# uses: actions/cache@v3 -# with: -# path: | -# .tox -# ~/.virtualenvs -# ~/.cache/pip -# ~/.cache/pypoetry -# key: cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python}} -# restore-keys: | -# cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python}} - - name: Prepare environment run: | pip install -U setuptools pip poetry tox-docker tox-poetry From 6c462ee98c736da440f7f3f8228c9f130c53719d Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 15:17:05 +0200 Subject: [PATCH 09/13] fixes 8 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d4a709a..85dda8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,8 +32,7 @@ repository = "https://github.com/RedisGraph/redisgraph-bulk-loader" [tool.poetry.dependencies] python = ">= 3.7.0" click = "^8.0.1" -# redis = "^4.5.1" -redis = "~= 4.3.4" +redis = "~= 4.5.1" pathos = "^0.2.8" [tool.poetry.dev-dependencies] From 4101e7c597e22b6c16195f80a30aef7a78b8c033 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 15:33:37 +0200 Subject: [PATCH 10/13] fixes 9 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 85dda8e..7fb4e20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ repository = "https://github.com/RedisGraph/redisgraph-bulk-loader" [tool.poetry.dependencies] python = ">= 3.7.0" click = "^8.0.1" -redis = "~= 4.5.1" +redis = "^4.5.1" pathos = "^0.2.8" [tool.poetry.dev-dependencies] From 2c116928c00b061f76c915a1798e14e00e7daa7a Mon Sep 17 00:00:00 2001 From: Avi Avni Date: Tue, 21 Mar 2023 17:59:52 +0200 Subject: [PATCH 11/13] fix build --- redisgraph_bulk_loader/bulk_update.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/redisgraph_bulk_loader/bulk_update.py b/redisgraph_bulk_loader/bulk_update.py index 1144c77..c7a74b4 100644 --- a/redisgraph_bulk_loader/bulk_update.py +++ b/redisgraph_bulk_loader/bulk_update.py @@ -195,7 +195,14 @@ def bulk_update( updater = BulkUpdate( graph, max_token_size, separator, no_header, csv, query, variable_name, client ) - updater.validate_query() + + if graph in client.keys(): + updater.validate_query() + else: + client.execute_command("GRAPH.QUERY", graph, "RETURN 1") + updater.validate_query() + client.execute_command("GRAPH.DELETE", graph) + updater.process_update_csv() end_time = timer() From 8c48cdac5065fba3a0f2e6ad93409137b4537e6d Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 18:53:38 +0200 Subject: [PATCH 12/13] fixes 10 --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7e358b3..655f7fa 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -45,7 +45,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true strategy: matrix: - platform: ['ubuntu-20.04', 'macos-11'] + platform: ['ubuntu-20.04'] python: ['3.7', '3.8', '3.9', '3.10', '3.11'] fail-fast: false steps: From 0abf71aeb3e1502e1f6d4808ea23b71bdf0c74d8 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 21 Mar 2023 18:55:52 +0200 Subject: [PATCH 13/13] fixes 11 --- redisgraph_bulk_loader/bulk_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisgraph_bulk_loader/bulk_update.py b/redisgraph_bulk_loader/bulk_update.py index c7a74b4..af169fa 100644 --- a/redisgraph_bulk_loader/bulk_update.py +++ b/redisgraph_bulk_loader/bulk_update.py @@ -195,7 +195,7 @@ def bulk_update( updater = BulkUpdate( graph, max_token_size, separator, no_header, csv, query, variable_name, client ) - + if graph in client.keys(): updater.validate_query() else: