diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 78001fe..655f7fa 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-version}} - restore-keys: | - lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}} - - name: prepare the environment run: | pip install -U setuptools pip poetry tox-docker tox-poetry @@ -51,40 +39,33 @@ 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: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] - name: Test Python ${{matrix.python-version}} + platform: ['ubuntu-20.04'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + fail-fast: false 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@v2 - 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: 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@v2 + uses: codecov/codecov-action@v3 + if: matrix.python == '3.9' && matrix.platform != 'macos-11' with: fail_ci_if_error: false - token: ${{ secrets.CODECOVTOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOVTOKEN }} diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 94e767f..24c933b 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -26,16 +26,16 @@ jobs: key: "tool.poetry.version" value: "${{ steps.get_version.outputs.VERSION }}" - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - 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 - name: Cache Poetry virtualenv - uses: actions/cache@v1 + uses: actions/cache@v3 id: cache with: path: ~/.virtualenvs diff --git a/pyproject.toml b/pyproject.toml index b598872..7fb4e20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisgraph-bulk-loader" -version = "0.11.0" +version = "0.12.0" description = "RedisGraph Bulk Import Tool" authors = ["Redis Inc "] license = "BSD-3-Clause" @@ -10,11 +10,11 @@ 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', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'License :: OSI Approved :: BSD License', 'Development Status :: 5 - Production/Stable' @@ -30,9 +30,9 @@ 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.3.4" +redis = "^4.5.1" pathos = "^0.2.8" [tool.poetry.dev-dependencies] diff --git a/redisgraph_bulk_loader/bulk_update.py b/redisgraph_bulk_loader/bulk_update.py index 1144c77..af169fa 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()