Skip to content

Redis-py 4.5 and Python 3.11 #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 13 additions & 32 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
token: ${{ secrets.CODECOVTOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <oss@redis.com>"]
license = "BSD-3-Clause"
Expand All @@ -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'

Expand All @@ -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]
Expand Down
9 changes: 8 additions & 1 deletion redisgraph_bulk_loader/bulk_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down