Skip to content

Commit 4cbf72d

Browse files
authored
Merge pull request #104 from RedisGraph/rafi-redispy4.5-1
Redis-py 4.5 and Python 3.11
2 parents c6248f6 + 0abf71a commit 4cbf72d

File tree

4 files changed

+29
-41
lines changed

4 files changed

+29
-41
lines changed

.github/workflows/integration.yml

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@ jobs:
3030
with:
3131
python-version: ${{env.basepython}}
3232

33-
- name: Cache paths
34-
uses: actions/cache@v2
35-
with:
36-
path: |
37-
.tox
38-
~/.virtualenvs
39-
~/.cache/pip
40-
~/.cache/pypoetry
41-
key: lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}}
42-
restore-keys: |
43-
lint-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}}
44-
4533
- name: prepare the environment
4634
run: |
4735
pip install -U setuptools pip poetry tox-docker tox-poetry
@@ -51,40 +39,33 @@ jobs:
5139
run: tox -e linters
5240

5341
tests:
54-
runs-on: ubuntu-latest
42+
name: Test on ${{ matrix.platform }} with Python ${{ matrix.python }}
43+
runs-on: ${{ matrix.platform }}
5544
env:
5645
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
5746
strategy:
5847
matrix:
59-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
60-
name: Test Python ${{matrix.python-version}}
48+
platform: ['ubuntu-20.04']
49+
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
50+
fail-fast: false
6151
steps:
6252
- uses: actions/checkout@v3
63-
- name: install base python
53+
- name: Setup Python
6454
uses: actions/setup-python@v4
6555
with:
66-
python-version: ${{matrix.python-version}}
67-
- name: Cache paths
68-
uses: actions/cache@v2
69-
with:
70-
path: |
71-
.tox
72-
~/.virtualenvs
73-
~/.cache/pip
74-
~/.cache/pypoetry
75-
key: cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}}
76-
restore-keys: |
77-
cover-${{ hashFiles('**/poetry.lock', '**/tox.ini', '**/pyproject.toml') }}-${{ matrix.python-version}}
56+
python-version: ${{matrix.python}}
57+
architecture: x64
7858

79-
- name: prepare the environment
59+
- name: Prepare environment
8060
run: |
8161
pip install -U setuptools pip poetry tox-docker tox-poetry
8262
poetry config virtualenvs.create false
8363
poetry install
84-
- name: run tests
64+
- name: Run tests
8565
run: tox -e cover
8666
- name: Upload coverage
87-
uses: codecov/codecov-action@v2
67+
uses: codecov/codecov-action@v3
68+
if: matrix.python == '3.9' && matrix.platform != 'macos-11'
8869
with:
8970
fail_ci_if_error: false
90-
token: ${{ secrets.CODECOVTOKEN }}
71+
token: ${{ secrets.CODECOVTOKEN }}

.github/workflows/publish-pypi.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ jobs:
2626
key: "tool.poetry.version"
2727
value: "${{ steps.get_version.outputs.VERSION }}"
2828

29-
- name: Set up Python 3.8
30-
uses: actions/setup-python@v1
29+
- name: Set up Python 3.9
30+
uses: actions/setup-python@v3
3131
with:
32-
python-version: 3.8
32+
python-version: 3.9
3333

3434
- name: Install Poetry
3535
uses: dschep/[email protected]
3636

3737
- name: Cache Poetry virtualenv
38-
uses: actions/cache@v1
38+
uses: actions/cache@v3
3939
id: cache
4040
with:
4141
path: ~/.virtualenvs

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisgraph-bulk-loader"
3-
version = "0.11.0"
3+
version = "0.12.0"
44
description = "RedisGraph Bulk Import Tool"
55
authors = ["Redis Inc <[email protected]>"]
66
license = "BSD-3-Clause"
@@ -10,11 +10,11 @@ classifiers = [
1010
'Topic :: Database',
1111
'Programming Language :: Python',
1212
'Intended Audience :: Developers',
13-
'Programming Language :: Python :: 3.6',
1413
'Programming Language :: Python :: 3.7',
1514
'Programming Language :: Python :: 3.8',
1615
'Programming Language :: Python :: 3.9',
1716
'Programming Language :: Python :: 3.10',
17+
'Programming Language :: Python :: 3.11',
1818
'License :: OSI Approved :: BSD License',
1919
'Development Status :: 5 - Production/Stable'
2020

@@ -30,9 +30,9 @@ url = "https://redisgraph.io"
3030
repository = "https://github.com/RedisGraph/redisgraph-bulk-loader"
3131

3232
[tool.poetry.dependencies]
33-
python = "^3.6.5"
33+
python = ">= 3.7.0"
3434
click = "^8.0.1"
35-
redis = "^4.3.4"
35+
redis = "^4.5.1"
3636
pathos = "^0.2.8"
3737

3838
[tool.poetry.dev-dependencies]

redisgraph_bulk_loader/bulk_update.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,14 @@ def bulk_update(
195195
updater = BulkUpdate(
196196
graph, max_token_size, separator, no_header, csv, query, variable_name, client
197197
)
198-
updater.validate_query()
198+
199+
if graph in client.keys():
200+
updater.validate_query()
201+
else:
202+
client.execute_command("GRAPH.QUERY", graph, "RETURN 1")
203+
updater.validate_query()
204+
client.execute_command("GRAPH.DELETE", graph)
205+
199206
updater.process_update_csv()
200207

201208
end_time = timer()

0 commit comments

Comments
 (0)