python-arango 8.3.3__tar.gz → 8.3.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_arango-8.3.5/.circleci/config.yml +207 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/.github/workflows/codeql.yaml +3 -5
- python_arango-8.3.5/.github/workflows/docs.yaml +47 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/.github/workflows/pypi.yaml +6 -18
- {python_arango-8.3.3 → python_arango-8.3.5}/PKG-INFO +3 -4
- {python_arango-8.3.3 → python_arango-8.3.5}/README.md +1 -1
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/collection.py +36 -10
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/connection.py +1 -2
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/database.py +14 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/formatter.py +4 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/replication.py +47 -175
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/utils.py +47 -17
- python_arango-8.3.5/arango/version.py +1 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/database.rst +8 -1
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/foxx.rst +1 -1
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/index.rst +1 -1
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/indexes.rst +39 -0
- python_arango-8.3.5/docs/replication.rst +61 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/pyproject.toml +1 -2
- {python_arango-8.3.3 → python_arango-8.3.5}/python_arango.egg-info/PKG-INFO +3 -4
- {python_arango-8.3.3 → python_arango-8.3.5}/python_arango.egg-info/SOURCES.txt +2 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/python_arango.egg-info/requires.txt +1 -1
- python_arango-8.3.5/python_arango.egg-info/scm_file_list.json +129 -0
- python_arango-8.3.5/python_arango.egg-info/scm_version.json +8 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/starter.sh +2 -2
- python_arango-8.3.3/.circleci/config.yml +0 -117
- python_arango-8.3.3/.github/workflows/docs.yaml +0 -103
- python_arango-8.3.3/arango/version.py +0 -1
- python_arango-8.3.3/docs/replication.rst +0 -115
- {python_arango-8.3.3 → python_arango-8.3.5}/.gitignore +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/.pre-commit-config.yaml +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/.readthedocs.yaml +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/CONTRIBUTING.md +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/LICENSE +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/MANIFEST.in +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/__init__.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/api.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/aql.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/backup.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/client.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/cluster.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/cursor.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/errno.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/exceptions.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/executor.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/foxx.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/graph.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/http.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/job.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/pregel.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/py.typed +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/request.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/resolver.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/response.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/result.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/typings.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/arango/wal.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/Makefile +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/admin.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/analyzer.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/aql.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/async.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/auth.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/backup.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/batch.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/certificates.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/cluster.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/collection.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/compression.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/conf.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/contributing.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/cursor.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/document.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/errno.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/errors.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/graph.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/http.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/logging.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/make.bat +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/overload.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/overview.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/pregel.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/requirements.txt +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/schema.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/serializer.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/simple.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/specs.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/static/logo.png +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/task.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/threading.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/transaction.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/user.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/view.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/docs/wal.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/python_arango.egg-info/dependency_links.txt +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/python_arango.egg-info/top_level.txt +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/setup.cfg +0 -0
- {python_arango-8.3.3 → python_arango-8.3.5}/setup.py +0 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
version: 2.1
|
|
2
|
+
|
|
3
|
+
executors:
|
|
4
|
+
python-container:
|
|
5
|
+
parameters:
|
|
6
|
+
python_version:
|
|
7
|
+
type: string
|
|
8
|
+
default: "3.14"
|
|
9
|
+
docker:
|
|
10
|
+
- image: cimg/python:<< parameters.python_version >>
|
|
11
|
+
resource_class: arangodb/small-amd64
|
|
12
|
+
arangodb-container:
|
|
13
|
+
parameters:
|
|
14
|
+
arangodb_image:
|
|
15
|
+
type: string
|
|
16
|
+
docker:
|
|
17
|
+
- image: << parameters.arangodb_image >>
|
|
18
|
+
entrypoint: /bin/sh
|
|
19
|
+
command: -c "while true; do sleep 10; done"
|
|
20
|
+
user: root
|
|
21
|
+
resource_class: arangodb/medium-amd64
|
|
22
|
+
|
|
23
|
+
workflows:
|
|
24
|
+
ci:
|
|
25
|
+
jobs:
|
|
26
|
+
- lint
|
|
27
|
+
- import-test:
|
|
28
|
+
name: Imports (Python << matrix.python_version >>)
|
|
29
|
+
matrix:
|
|
30
|
+
parameters:
|
|
31
|
+
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
32
|
+
- integration-test:
|
|
33
|
+
name: ArangoDB (enterprise, 3.12 << matrix.arangodb_config >>)
|
|
34
|
+
matrix:
|
|
35
|
+
parameters:
|
|
36
|
+
arangodb_config: ["single", "cluster"]
|
|
37
|
+
arangodb_image: ["arangodb/enterprise:3.12"]
|
|
38
|
+
arangodb_conf_version: ["3.12"]
|
|
39
|
+
- integration-test:
|
|
40
|
+
name: ArangoDB (core-preview, 4.0-nightly << matrix.arangodb_config >>)
|
|
41
|
+
matrix:
|
|
42
|
+
parameters:
|
|
43
|
+
arangodb_config: [ "single", "cluster" ]
|
|
44
|
+
arangodb_image: [ "arangodb/core-preview:4.0-nightly" ]
|
|
45
|
+
arangodb_conf_version: [ "4.0" ]
|
|
46
|
+
- integration-test:
|
|
47
|
+
name: ArangoDB (enterprise-preview, 3.12-nightly << matrix.arangodb_config >>)
|
|
48
|
+
matrix:
|
|
49
|
+
parameters:
|
|
50
|
+
arangodb_config: ["single", "cluster"]
|
|
51
|
+
arangodb_image: ["arangodb/enterprise-preview:3.12-nightly"]
|
|
52
|
+
arangodb_conf_version: ["3.12"]
|
|
53
|
+
|
|
54
|
+
jobs:
|
|
55
|
+
lint:
|
|
56
|
+
executor: python-container
|
|
57
|
+
steps:
|
|
58
|
+
- checkout
|
|
59
|
+
- run:
|
|
60
|
+
name: Install Dependencies
|
|
61
|
+
command: python -m pip install .[dev]
|
|
62
|
+
- run:
|
|
63
|
+
name: Run black
|
|
64
|
+
command: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/
|
|
65
|
+
- run:
|
|
66
|
+
name: Run flake8
|
|
67
|
+
command: flake8 ./arango ./tests
|
|
68
|
+
- run:
|
|
69
|
+
name: Run isort
|
|
70
|
+
command: isort --check ./arango ./tests
|
|
71
|
+
- run:
|
|
72
|
+
name: Run mypy
|
|
73
|
+
command: mypy ./arango
|
|
74
|
+
import-test:
|
|
75
|
+
parameters:
|
|
76
|
+
python_version:
|
|
77
|
+
type: string
|
|
78
|
+
executor:
|
|
79
|
+
name: python-container
|
|
80
|
+
python_version: << parameters.python_version >>
|
|
81
|
+
steps:
|
|
82
|
+
- checkout
|
|
83
|
+
- run:
|
|
84
|
+
name: Install Dependencies
|
|
85
|
+
command: |
|
|
86
|
+
python --version
|
|
87
|
+
python -m pip install .[dev]
|
|
88
|
+
- run:
|
|
89
|
+
name: Run Import Tests
|
|
90
|
+
command: python -m pytest tests/test_imports.py --skip-arango-setup --color=yes --code-highlight=yes
|
|
91
|
+
integration-test:
|
|
92
|
+
parameters:
|
|
93
|
+
arangodb_config:
|
|
94
|
+
type: string
|
|
95
|
+
arangodb_image:
|
|
96
|
+
type: string
|
|
97
|
+
arangodb_conf_version:
|
|
98
|
+
type: string
|
|
99
|
+
executor:
|
|
100
|
+
name: arangodb-container
|
|
101
|
+
arangodb_image: << parameters.arangodb_image >>
|
|
102
|
+
steps:
|
|
103
|
+
- run:
|
|
104
|
+
name: Bootstrap CI Tools
|
|
105
|
+
command: |
|
|
106
|
+
apk add --no-cache \
|
|
107
|
+
bash \
|
|
108
|
+
build-base \
|
|
109
|
+
ca-certificates \
|
|
110
|
+
curl \
|
|
111
|
+
git \
|
|
112
|
+
jq \
|
|
113
|
+
openssh-client \
|
|
114
|
+
openssl-dev \
|
|
115
|
+
py3-pip \
|
|
116
|
+
py3-virtualenv \
|
|
117
|
+
python3 \
|
|
118
|
+
python3-dev
|
|
119
|
+
- checkout
|
|
120
|
+
- run:
|
|
121
|
+
name: Setup ArangoDB
|
|
122
|
+
command: |
|
|
123
|
+
mkdir -p /tests
|
|
124
|
+
if [ ! -e /tests/static ]; then
|
|
125
|
+
ln -s "$PWD/tests/static" /tests/static
|
|
126
|
+
fi
|
|
127
|
+
|
|
128
|
+
conf_file="/tests/static/<< parameters.arangodb_config >>-<< parameters.arangodb_conf_version >>.conf"
|
|
129
|
+
if [ ! -f "$conf_file" ]; then
|
|
130
|
+
echo "Missing configuration file: $conf_file"
|
|
131
|
+
exit 1
|
|
132
|
+
fi
|
|
133
|
+
|
|
134
|
+
arangodb --configuration="$conf_file" > arangodb.log 2>&1 &
|
|
135
|
+
echo "$!" > arangodb.pid
|
|
136
|
+
|
|
137
|
+
ports="8529"
|
|
138
|
+
if [ << parameters.arangodb_config >> = "cluster" ]; then
|
|
139
|
+
ports="$ports 8539 8549"
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
for port in $ports; do
|
|
143
|
+
echo "Waiting for ArangoDB at http://localhost:$port/_api/version"
|
|
144
|
+
for attempt in $(seq 1 120); do
|
|
145
|
+
if curl --fail --silent --show-error \
|
|
146
|
+
--user root:passwd \
|
|
147
|
+
"http://localhost:$port/_api/version" | jq; then
|
|
148
|
+
break
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
if ! kill -0 "$(cat arangodb.pid)" 2>/dev/null; then
|
|
152
|
+
echo "ArangoDB process exited before port $port became ready"
|
|
153
|
+
exit 1
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
if [ "$attempt" -eq 120 ]; then
|
|
157
|
+
echo "Timed out waiting for ArangoDB on port $port"
|
|
158
|
+
exit 1
|
|
159
|
+
fi
|
|
160
|
+
|
|
161
|
+
sleep 1
|
|
162
|
+
done
|
|
163
|
+
done
|
|
164
|
+
- run:
|
|
165
|
+
name: Show ArangoDB Logs
|
|
166
|
+
command: tail -n 1000 arangodb.log
|
|
167
|
+
when: always
|
|
168
|
+
- run:
|
|
169
|
+
name: Setup Python
|
|
170
|
+
shell: /bin/bash -eo pipefail
|
|
171
|
+
command: |
|
|
172
|
+
python3 --version
|
|
173
|
+
python3 -m virtualenv .venv
|
|
174
|
+
source .venv/bin/activate
|
|
175
|
+
python --version
|
|
176
|
+
python -m pip --version
|
|
177
|
+
- run:
|
|
178
|
+
name: Install Dependencies
|
|
179
|
+
shell: /bin/bash -eo pipefail
|
|
180
|
+
command: |
|
|
181
|
+
source .venv/bin/activate
|
|
182
|
+
python -m pip install -e .[dev]
|
|
183
|
+
- run:
|
|
184
|
+
name: Run pytest
|
|
185
|
+
shell: /bin/bash -eo pipefail
|
|
186
|
+
command: |
|
|
187
|
+
mkdir test-results
|
|
188
|
+
mkdir htmlcov
|
|
189
|
+
|
|
190
|
+
source .venv/bin/activate
|
|
191
|
+
|
|
192
|
+
args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529")
|
|
193
|
+
if [ << parameters.arangodb_config >> = "cluster" ]; then
|
|
194
|
+
args+=("--cluster" "--port=8539" "--port=8549")
|
|
195
|
+
fi
|
|
196
|
+
|
|
197
|
+
echo "Running pytest with args: ${args[@]}"
|
|
198
|
+
pytest tests --cov=arango --cov-report=html:htmlcov --color=yes --code-highlight=yes "${args[@]}"
|
|
199
|
+
- store_artifacts:
|
|
200
|
+
path: htmlcov
|
|
201
|
+
destination: coverage-report
|
|
202
|
+
- store_artifacts:
|
|
203
|
+
path: test-results
|
|
204
|
+
- store_artifacts:
|
|
205
|
+
path: arangodb.log
|
|
206
|
+
- store_test_results:
|
|
207
|
+
path: test-results
|
|
@@ -3,8 +3,6 @@ name: CodeQL
|
|
|
3
3
|
on:
|
|
4
4
|
pull_request:
|
|
5
5
|
branches: [main]
|
|
6
|
-
schedule:
|
|
7
|
-
- cron: '21 2 * * 3'
|
|
8
6
|
|
|
9
7
|
jobs:
|
|
10
8
|
analyze:
|
|
@@ -16,10 +14,10 @@ jobs:
|
|
|
16
14
|
|
|
17
15
|
steps:
|
|
18
16
|
- name: Checkout repository
|
|
19
|
-
uses: actions/checkout@
|
|
17
|
+
uses: actions/checkout@v7
|
|
20
18
|
|
|
21
19
|
- name: Initialize CodeQL
|
|
22
|
-
uses: github/codeql-action/init@
|
|
20
|
+
uses: github/codeql-action/init@v4
|
|
23
21
|
|
|
24
22
|
- name: Perform CodeQL Analysis
|
|
25
|
-
uses: github/codeql-action/analyze@
|
|
23
|
+
uses: github/codeql-action/analyze@v4
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
docs:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
name: Docs
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout repository
|
|
14
|
+
uses: actions/checkout@v7
|
|
15
|
+
|
|
16
|
+
- name: Fetch all tags and branches
|
|
17
|
+
run: git fetch --prune --unshallow
|
|
18
|
+
|
|
19
|
+
- name: Create ArangoDB Docker container
|
|
20
|
+
run: >
|
|
21
|
+
docker create --name arango -p 8529:8529 -e ARANGO_ROOT_PASSWORD=passwd -v "$(pwd)/tests/static/":/tests/static
|
|
22
|
+
arangodb/enterprise:latest --server.jwt-secret-keyfile=/tests/static/keyfile --vector-index=true
|
|
23
|
+
|
|
24
|
+
- name: Start ArangoDB Docker container
|
|
25
|
+
run: docker start arango
|
|
26
|
+
|
|
27
|
+
- name: Wait for ArangoDB
|
|
28
|
+
run: |
|
|
29
|
+
for _ in {1..30}; do
|
|
30
|
+
if curl --fail --silent --user root:passwd http://localhost:8529/_api/version > /dev/null; then
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
sleep 1
|
|
34
|
+
done
|
|
35
|
+
docker logs arango
|
|
36
|
+
exit 1
|
|
37
|
+
|
|
38
|
+
- name: Set up Python
|
|
39
|
+
uses: actions/setup-python@v7
|
|
40
|
+
with:
|
|
41
|
+
python-version: '3.12'
|
|
42
|
+
|
|
43
|
+
- name: Install dependencies
|
|
44
|
+
run: pip install .[dev]
|
|
45
|
+
|
|
46
|
+
- name: Run Sphinx doctest
|
|
47
|
+
run: python -m sphinx -b doctest docs docs/_build
|
|
@@ -3,13 +3,6 @@ name: Upload to PyPI
|
|
|
3
3
|
on:
|
|
4
4
|
release:
|
|
5
5
|
types: [published]
|
|
6
|
-
workflow_dispatch:
|
|
7
|
-
inputs:
|
|
8
|
-
debug_enabled:
|
|
9
|
-
type: boolean
|
|
10
|
-
description: Debug with tmate
|
|
11
|
-
required: false
|
|
12
|
-
default: false
|
|
13
6
|
|
|
14
7
|
jobs:
|
|
15
8
|
upload:
|
|
@@ -17,19 +10,14 @@ jobs:
|
|
|
17
10
|
|
|
18
11
|
steps:
|
|
19
12
|
- name: Checkout repository
|
|
20
|
-
uses: actions/checkout@
|
|
21
|
-
|
|
22
|
-
- name: Fetch all tags and branches
|
|
23
|
-
run: git fetch --prune --unshallow
|
|
24
|
-
|
|
25
|
-
- name: Set up Python
|
|
26
|
-
uses: actions/setup-python@v4
|
|
13
|
+
uses: actions/checkout@v7
|
|
27
14
|
with:
|
|
28
|
-
|
|
15
|
+
fetch-depth: 0
|
|
16
|
+
fetch-tags: true
|
|
29
17
|
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
- uses: actions/setup-python@v7
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
33
21
|
|
|
34
22
|
- name: Install dependencies
|
|
35
23
|
run: |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-arango
|
|
3
|
-
Version: 8.3.
|
|
3
|
+
Version: 8.3.5
|
|
4
4
|
Summary: Python Driver for ArangoDB
|
|
5
5
|
Author-email: Joohwan Oh <joohwan.oh@outlook.com>
|
|
6
6
|
Maintainer-email: Joohwan Oh <joohwan.oh@outlook.com>, Alexandru Petenchea <alex.petenchea@gmail.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
@@ -33,7 +33,6 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
33
33
|
Classifier: Natural Language :: English
|
|
34
34
|
Classifier: Operating System :: OS Independent
|
|
35
35
|
Classifier: Programming Language :: Python :: 3
|
|
36
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
37
36
|
Classifier: Programming Language :: Python :: 3.10
|
|
38
37
|
Classifier: Programming Language :: Python :: 3.11
|
|
39
38
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -48,7 +47,7 @@ Requires-Dist: requests_toolbelt
|
|
|
48
47
|
Requires-Dist: PyJWT>=2.10.0
|
|
49
48
|
Requires-Dist: packaging>=23.1
|
|
50
49
|
Provides-Extra: dev
|
|
51
|
-
Requires-Dist: black==26.1
|
|
50
|
+
Requires-Dist: black==26.5.1; extra == "dev"
|
|
52
51
|
Requires-Dist: flake8==7.3.0; extra == "dev"
|
|
53
52
|
Requires-Dist: isort==5.10.1; extra == "dev"
|
|
54
53
|
Requires-Dist: mypy==1.15.0; extra == "dev"
|
|
@@ -89,7 +88,7 @@ If you're interested in using asyncio, please check [python-arango-async](https:
|
|
|
89
88
|
## Requirements
|
|
90
89
|
|
|
91
90
|
- ArangoDB version 3.11+
|
|
92
|
-
- Python version 3.
|
|
91
|
+
- Python version 3.10+
|
|
93
92
|
|
|
94
93
|
## Installation
|
|
95
94
|
|
|
@@ -816,14 +816,20 @@ class Collection(ApiGroup):
|
|
|
816
816
|
|
|
817
817
|
skip_val = skip if skip is not None else 0
|
|
818
818
|
limit_val = limit if limit is not None else "null"
|
|
819
|
+
filter_conditions, filter_bind_vars = build_filter_conditions(filters)
|
|
820
|
+
sort_expression, sort_bind_vars = build_sort_expression(sort)
|
|
819
821
|
query = f"""
|
|
820
822
|
FOR doc IN @@collection
|
|
821
|
-
{
|
|
823
|
+
{filter_conditions}
|
|
822
824
|
LIMIT {skip_val}, {limit_val}
|
|
823
|
-
{
|
|
825
|
+
{sort_expression}
|
|
824
826
|
RETURN doc
|
|
825
827
|
"""
|
|
826
|
-
bind_vars = {
|
|
828
|
+
bind_vars = {
|
|
829
|
+
"@collection": self.name,
|
|
830
|
+
**filter_bind_vars,
|
|
831
|
+
**sort_bind_vars,
|
|
832
|
+
}
|
|
827
833
|
|
|
828
834
|
request = Request(
|
|
829
835
|
method="post",
|
|
@@ -1268,17 +1274,29 @@ class Collection(ApiGroup):
|
|
|
1268
1274
|
# Index Management #
|
|
1269
1275
|
####################
|
|
1270
1276
|
|
|
1271
|
-
def indexes(
|
|
1277
|
+
def indexes(
|
|
1278
|
+
self, with_stats: bool = False, with_hidden: bool = False
|
|
1279
|
+
) -> Result[Jsons]:
|
|
1272
1280
|
"""Return the collection indexes.
|
|
1273
1281
|
|
|
1282
|
+
:param with_stats: Whether to include figures and estimates in the result.
|
|
1283
|
+
:type with_stats: bool
|
|
1284
|
+
:param with_hidden: Whether to include hidden indexes in the result.
|
|
1285
|
+
:type with_hidden: bool
|
|
1274
1286
|
:return: Collection indexes.
|
|
1275
1287
|
:rtype: [dict]
|
|
1276
1288
|
:raise arango.exceptions.IndexListError: If retrieval fails.
|
|
1277
1289
|
"""
|
|
1290
|
+
params: Params = {"collection": self.name}
|
|
1291
|
+
if with_stats:
|
|
1292
|
+
params["withStats"] = True
|
|
1293
|
+
if with_hidden:
|
|
1294
|
+
params["withHidden"] = True
|
|
1295
|
+
|
|
1278
1296
|
request = Request(
|
|
1279
1297
|
method="get",
|
|
1280
1298
|
endpoint="/_api/index",
|
|
1281
|
-
params=
|
|
1299
|
+
params=params,
|
|
1282
1300
|
)
|
|
1283
1301
|
|
|
1284
1302
|
def response_handler(resp: Response) -> Jsons:
|
|
@@ -1920,9 +1938,10 @@ class Collection(ApiGroup):
|
|
|
1920
1938
|
# then the collection’s default waitForSync behavior is applied.
|
|
1921
1939
|
sync_val = f", waitForSync: {sync}" if sync is not None else ""
|
|
1922
1940
|
|
|
1941
|
+
filter_conditions, filter_bind_vars = build_filter_conditions(filters)
|
|
1923
1942
|
query = f"""
|
|
1924
1943
|
FOR doc IN @@collection
|
|
1925
|
-
{
|
|
1944
|
+
{filter_conditions}
|
|
1926
1945
|
{f"LIMIT {limit}" if limit is not None else ""}
|
|
1927
1946
|
UPDATE doc WITH @body IN @@collection
|
|
1928
1947
|
OPTIONS {{ keepNull: @keep_none, mergeObjects: @merge {sync_val} }}
|
|
@@ -1933,6 +1952,7 @@ class Collection(ApiGroup):
|
|
|
1933
1952
|
"body": body,
|
|
1934
1953
|
"keep_none": keep_none,
|
|
1935
1954
|
"merge": merge,
|
|
1955
|
+
**filter_bind_vars,
|
|
1936
1956
|
}
|
|
1937
1957
|
|
|
1938
1958
|
request = Request(
|
|
@@ -2089,15 +2109,20 @@ class Collection(ApiGroup):
|
|
|
2089
2109
|
# then the collection’s default waitForSync behavior is applied.
|
|
2090
2110
|
sync_val = f"waitForSync: {sync}" if sync is not None else ""
|
|
2091
2111
|
|
|
2112
|
+
filter_conditions, filter_bind_vars = build_filter_conditions(filters)
|
|
2092
2113
|
query = f"""
|
|
2093
2114
|
FOR doc IN @@collection
|
|
2094
|
-
{
|
|
2115
|
+
{filter_conditions}
|
|
2095
2116
|
{f"LIMIT {limit}" if limit is not None else ""}
|
|
2096
2117
|
REPLACE doc WITH @body IN @@collection
|
|
2097
2118
|
{f"OPTIONS {{ {sync_val} }}" if sync_val else ""}
|
|
2098
2119
|
""" # noqa: E201 E202
|
|
2099
2120
|
|
|
2100
|
-
bind_vars = {
|
|
2121
|
+
bind_vars = {
|
|
2122
|
+
"@collection": self.name,
|
|
2123
|
+
"body": body,
|
|
2124
|
+
**filter_bind_vars,
|
|
2125
|
+
}
|
|
2101
2126
|
|
|
2102
2127
|
request = Request(
|
|
2103
2128
|
method="post",
|
|
@@ -2248,15 +2273,16 @@ class Collection(ApiGroup):
|
|
|
2248
2273
|
# then the collection’s default waitForSync behavior is applied.
|
|
2249
2274
|
sync_val = f"waitForSync: {sync}" if sync is not None else ""
|
|
2250
2275
|
|
|
2276
|
+
filter_conditions, filter_bind_vars = build_filter_conditions(filters)
|
|
2251
2277
|
query = f"""
|
|
2252
2278
|
FOR doc IN @@collection
|
|
2253
|
-
{
|
|
2279
|
+
{filter_conditions}
|
|
2254
2280
|
{f"LIMIT {limit}" if limit is not None else ""}
|
|
2255
2281
|
REMOVE doc IN @@collection
|
|
2256
2282
|
{f"OPTIONS {{ {sync_val} }}" if sync_val else ""}
|
|
2257
2283
|
""" # noqa: E201 E202
|
|
2258
2284
|
|
|
2259
|
-
bind_vars = {"@collection": self.name}
|
|
2285
|
+
bind_vars = {"@collection": self.name, **filter_bind_vars}
|
|
2260
2286
|
|
|
2261
2287
|
request = Request(
|
|
2262
2288
|
method="post",
|
|
@@ -120,8 +120,7 @@ class BaseConnection:
|
|
|
120
120
|
else:
|
|
121
121
|
resp.body = resp.raw_body
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
resp.is_success = http_ok and resp.error_code is None
|
|
123
|
+
resp.is_success = 200 <= resp.status_code < 300
|
|
125
124
|
return resp
|
|
126
125
|
|
|
127
126
|
def process_request(
|
|
@@ -1128,6 +1128,20 @@ class Database(ApiGroup):
|
|
|
1128
1128
|
|
|
1129
1129
|
return self._execute(request, response_handler)
|
|
1130
1130
|
|
|
1131
|
+
def request(self, request: Request) -> Result[Response]:
|
|
1132
|
+
"""Execute a custom request.
|
|
1133
|
+
|
|
1134
|
+
:param request: Request object to be executed.
|
|
1135
|
+
:type request: Request
|
|
1136
|
+
:return: Response object containing the result of the request.
|
|
1137
|
+
:rtype: Response
|
|
1138
|
+
"""
|
|
1139
|
+
|
|
1140
|
+
def response_handler(resp: Response) -> Response:
|
|
1141
|
+
return resp
|
|
1142
|
+
|
|
1143
|
+
return self._executor.execute(request, response_handler)
|
|
1144
|
+
|
|
1131
1145
|
def metrics(self) -> Result[str]:
|
|
1132
1146
|
"""Return server metrics in Prometheus format.
|
|
1133
1147
|
|
|
@@ -73,6 +73,8 @@ def format_index(body: Json, formatter: bool = True) -> Json:
|
|
|
73
73
|
result["cacheEnabled"] = body["cacheEnabled"]
|
|
74
74
|
if "legacyPolygons" in body:
|
|
75
75
|
result["legacyPolygons"] = body["legacyPolygons"]
|
|
76
|
+
if "figures" in body:
|
|
77
|
+
result["figures"] = body["figures"]
|
|
76
78
|
if "estimates" in body:
|
|
77
79
|
result["estimates"] = body["estimates"]
|
|
78
80
|
if "analyzer" in body:
|
|
@@ -123,6 +125,8 @@ def format_index(body: Json, formatter: bool = True) -> Json:
|
|
|
123
125
|
result["error_message"] = body["errorMessage"]
|
|
124
126
|
if "trainingState" in body:
|
|
125
127
|
result["training_state"] = body["trainingState"]
|
|
128
|
+
if "shards" in body:
|
|
129
|
+
result["shards"] = body["shards"]
|
|
126
130
|
|
|
127
131
|
return verify_format(body, result)
|
|
128
132
|
|