python-arango-async 1.2.5__tar.gz → 1.2.7__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_async-1.2.5 → python_arango_async-1.2.7}/.circleci/config.yml +12 -12
- python_arango_async-1.2.7/.github/workflows/pypi.yaml +66 -0
- python_arango_async-1.2.7/AGENTS.md +91 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/PKG-INFO +1 -1
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/database.py +26 -10
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/graph.py +3 -2
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/typings.py +28 -0
- python_arango_async-1.2.7/arangoasync/version.py +1 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/graph.rst +39 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/indexes.rst +6 -3
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/python_arango_async.egg-info/PKG-INFO +1 -1
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/python_arango_async.egg-info/SOURCES.txt +1 -1
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/python_arango_async.egg-info/scm_file_list.json +1 -1
- python_arango_async-1.2.7/python_arango_async.egg-info/scm_version.json +8 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/starter.sh +3 -2
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_aql.py +2 -2
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_collection.py +24 -18
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_graph.py +78 -2
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_typings.py +23 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_user.py +9 -0
- python_arango_async-1.2.5/.github/workflows/pypi.yaml +0 -40
- python_arango_async-1.2.5/CONTRIBUTING.md +0 -28
- python_arango_async-1.2.5/arangoasync/version.py +0 -1
- python_arango_async-1.2.5/python_arango_async.egg-info/scm_version.json +0 -8
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/.github/workflows/codeql.yaml +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/.github/workflows/docs.yaml +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/.gitignore +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/.pre-commit-config.yaml +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/.readthedocs.yaml +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/LICENSE +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/README.md +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/__init__.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/aql.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/auth.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/backup.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/client.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/cluster.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/collection.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/compression.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/connection.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/cursor.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/errno.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/exceptions.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/executor.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/foxx.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/http.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/job.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/logger.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/replication.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/request.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/resolver.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/response.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/result.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/arangoasync/serialization.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/admin.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/analyzer.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/aql.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/async.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/authentication.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/backup.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/certificates.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/cluster.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/collection.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/compression.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/conf.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/cursor.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/database.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/document.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/errno.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/errors.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/foxx.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/helpers.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/http.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/index.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/logging.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/migration.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/overview.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/serialization.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/specs.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/static/logo.png +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/task.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/transaction.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/user.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/docs/view.rst +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/pyproject.toml +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/python_arango_async.egg-info/dependency_links.txt +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/python_arango_async.egg-info/requires.txt +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/python_arango_async.egg-info/top_level.txt +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/setup.cfg +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/setup.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/__init__.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/conftest.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/helpers.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/static/cluster-3.12.conf +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/static/cluster-4.0.conf +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/static/keyfile +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/static/service.zip +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/static/single-3.12.conf +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/static/single-4.0.conf +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_analyzer.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_async.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_backup.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_client.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_cluster.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_compression.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_connection.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_cursor.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_database.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_document.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_foxx.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_http.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_imports.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_resolver.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_task.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_transaction.py +0 -0
- {python_arango_async-1.2.5 → python_arango_async-1.2.7}/tests/test_view.py +0 -0
|
@@ -30,11 +30,11 @@ workflows:
|
|
|
30
30
|
parameters:
|
|
31
31
|
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
32
32
|
- integration-test:
|
|
33
|
-
name: ArangoDB (enterprise, 3.12 << matrix.arangodb_config >>)
|
|
33
|
+
name: ArangoDB (enterprise, 3.12.9 << matrix.arangodb_config >>)
|
|
34
34
|
matrix:
|
|
35
35
|
parameters:
|
|
36
36
|
arangodb_config: ["single", "cluster"]
|
|
37
|
-
arangodb_image: ["arangodb/enterprise:3.12"]
|
|
37
|
+
arangodb_image: ["arangodb/enterprise:3.12.9"]
|
|
38
38
|
arangodb_conf_version: ["3.12"]
|
|
39
39
|
- integration-test:
|
|
40
40
|
name: ArangoDB (core-preview, 4.0-nightly << matrix.arangodb_config >>)
|
|
@@ -44,11 +44,11 @@ workflows:
|
|
|
44
44
|
arangodb_image: [ "arangodb/core-preview:4.0-nightly" ]
|
|
45
45
|
arangodb_conf_version: [ "4.0" ]
|
|
46
46
|
- integration-test:
|
|
47
|
-
name: ArangoDB (enterprise
|
|
47
|
+
name: ArangoDB (enterprise, 3.12-latest << matrix.arangodb_config >>)
|
|
48
48
|
matrix:
|
|
49
49
|
parameters:
|
|
50
50
|
arangodb_config: ["single", "cluster"]
|
|
51
|
-
arangodb_image: ["arangodb/enterprise
|
|
51
|
+
arangodb_image: ["arangodb/enterprise:3.12"]
|
|
52
52
|
arangodb_conf_version: ["3.12"]
|
|
53
53
|
|
|
54
54
|
jobs:
|
|
@@ -60,8 +60,8 @@ jobs:
|
|
|
60
60
|
name: Install Dependencies
|
|
61
61
|
command: python -m pip install .[dev]
|
|
62
62
|
- run:
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
name: Run black
|
|
64
|
+
command: black --check --verbose --diff --color --config=pyproject.toml ./arangoasync ./tests/
|
|
65
65
|
- run:
|
|
66
66
|
name: Run flake8
|
|
67
67
|
command: flake8 ./arangoasync ./tests
|
|
@@ -90,12 +90,12 @@ jobs:
|
|
|
90
90
|
command: python -m pytest tests/test_imports.py --skip-arango-setup --color=yes --code-highlight=yes
|
|
91
91
|
integration-test:
|
|
92
92
|
parameters:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
arangodb_config:
|
|
94
|
+
type: string
|
|
95
|
+
arangodb_image:
|
|
96
|
+
type: string
|
|
97
|
+
arangodb_conf_version:
|
|
98
|
+
type: string
|
|
99
99
|
executor:
|
|
100
100
|
name: arangodb-container
|
|
101
101
|
arangodb_image: << parameters.arangodb_image >>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout repository
|
|
16
|
+
uses: actions/checkout@v7
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
fetch-tags: true
|
|
20
|
+
persist-credentials: false
|
|
21
|
+
|
|
22
|
+
- uses: actions/setup-python@v7
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.12"
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: python -m pip install build
|
|
28
|
+
|
|
29
|
+
- name: Build distribution
|
|
30
|
+
run: python -m build
|
|
31
|
+
|
|
32
|
+
- uses: actions/upload-artifact@v5
|
|
33
|
+
with:
|
|
34
|
+
name: dist
|
|
35
|
+
path: dist/
|
|
36
|
+
if-no-files-found: error
|
|
37
|
+
|
|
38
|
+
testpypi:
|
|
39
|
+
needs: build
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
environment: testpypi
|
|
42
|
+
permissions:
|
|
43
|
+
id-token: write
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/download-artifact@v6
|
|
46
|
+
with:
|
|
47
|
+
name: dist
|
|
48
|
+
path: dist/
|
|
49
|
+
- name: Publish to TestPyPI
|
|
50
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
51
|
+
with:
|
|
52
|
+
repository-url: https://test.pypi.org/legacy/
|
|
53
|
+
|
|
54
|
+
pypi:
|
|
55
|
+
needs: testpypi
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
environment: pypi
|
|
58
|
+
permissions:
|
|
59
|
+
id-token: write
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/download-artifact@v6
|
|
62
|
+
with:
|
|
63
|
+
name: dist
|
|
64
|
+
path: dist/
|
|
65
|
+
- name: Publish to PyPI
|
|
66
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
|
|
3
|
+
python-arango-async is an async Python driver for ArangoDB. Run the commands below from the
|
|
4
|
+
repository root.
|
|
5
|
+
|
|
6
|
+
## Repository layout
|
|
7
|
+
|
|
8
|
+
- `arangoasync/`: driver implementation, public APIs, and type annotations.
|
|
9
|
+
- `tests/`: pytest tests; `conftest.py` defines database fixtures and CLI options.
|
|
10
|
+
- `tests/static/`: server configurations and test data used by `starter.sh`.
|
|
11
|
+
- `docs/`: Sphinx documentation in reStructuredText.
|
|
12
|
+
- `pyproject.toml`, `setup.cfg`, `.pre-commit-config.yaml`: packaging and tooling.
|
|
13
|
+
- `.circleci/`, `.github/workflows/`: CI checks, documentation, and publishing.
|
|
14
|
+
|
|
15
|
+
## Development setup
|
|
16
|
+
|
|
17
|
+
Use Python 3.10 or newer. Create a virtual environment, or use an existing one:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
python3 -m venv .venv # Create an isolated Python environment.
|
|
21
|
+
source .venv/bin/activate # Use its interpreter and tools.
|
|
22
|
+
python -m pip install -e '.[dev]' # Install the editable driver and dev tools.
|
|
23
|
+
pre-commit install # Enable checks before each commit.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Examples use `python` from the activated environment. If it is unavailable on
|
|
27
|
+
PATH, invoke your environment's interpreter directly. In this workspace, use
|
|
28
|
+
`/home/apetenchea/programs/pyenv/ida/bin/python` and run tests from
|
|
29
|
+
`/home/apetenchea/arangodb/python-arango-async`, so they exercise this driver.
|
|
30
|
+
|
|
31
|
+
## Local cluster and tests
|
|
32
|
+
|
|
33
|
+
The starter requires Docker, Bash, `wget`, and `jq`. To replace an existing test
|
|
34
|
+
container, run `docker stop arango` and `docker rm arango` first.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
version="latest" # Or pin a supported version, such as 3.12.10.
|
|
38
|
+
./starter.sh cluster enterprise "$version" # Start a local test cluster.
|
|
39
|
+
python -m pytest --cluster # Run the full suite against the cluster.
|
|
40
|
+
# Run one test while developing a document change.
|
|
41
|
+
python -m pytest --cluster tests/test_document.py::test_document_insert
|
|
42
|
+
# Generate an HTML coverage report.
|
|
43
|
+
python -m pytest --cluster --cov=arangoasync --cov-report=html
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Defaults are `127.0.0.1:8529`, user `root`, password `passwd`, and JWT secret
|
|
47
|
+
`secret`, matching the starter configuration. Override them with `--host`,
|
|
48
|
+
`--port`, `--root`, `--password`, and `--secret`. Use a disposable development
|
|
49
|
+
database: tests create and delete databases, users, jobs, and backups. If a
|
|
50
|
+
sandbox blocks localhost access, rerun with the required sandbox permission.
|
|
51
|
+
|
|
52
|
+
For a single server, use `./starter.sh single enterprise "$version"` and omit
|
|
53
|
+
`--cluster`. Import tests can run without ArangoDB:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python -m pytest tests/test_imports.py --skip-arango-setup # Check imports offline.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Style and documentation
|
|
60
|
+
|
|
61
|
+
Run the configured hooks for formatting, import ordering, linting, and type
|
|
62
|
+
checks. Build and test documentation separately:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pre-commit run --all-files # Run hooks; formatters may modify files.
|
|
66
|
+
python -m sphinx -b html docs docs/_build # Build the HTML documentation.
|
|
67
|
+
python -m sphinx -b doctest docs docs/_build # Test documentation examples.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The Sphinx doctests require a running ArangoDB server. Open
|
|
71
|
+
`docs/_build/index.html` for the HTML documentation or `htmlcov/index.html` for
|
|
72
|
+
the coverage report.
|
|
73
|
+
|
|
74
|
+
## Changes and pull requests
|
|
75
|
+
|
|
76
|
+
- Agents must work on a branch other than `main`; never commit directly to `main`.
|
|
77
|
+
Check the current branch before editing or committing. If on `main` or a
|
|
78
|
+
detached HEAD, create a branch first:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
git branch --show-current # Check the current branch.
|
|
82
|
+
git switch -c fix/describe-change # Choose a descriptive branch name.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- Preserve public API compatibility unless a breaking change is intentional.
|
|
86
|
+
- Follow existing code patterns, type annotations, and Sphinx docstrings.
|
|
87
|
+
- Add regression tests for fixes and tests for new behavior; update user documentation.
|
|
88
|
+
- Run relevant tests and checks; report anything skipped and why.
|
|
89
|
+
- Keep test coverage up and squash changes into one commit for submission.
|
|
90
|
+
- Use present-tense commit messages, such as `Fix cursor retry`.
|
|
91
|
+
- Explain what changed, why, and any compatibility impact in the pull request.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-arango-async
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.7
|
|
4
4
|
Summary: Async Python Driver for ArangoDB
|
|
5
5
|
Author-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
6
6
|
Maintainer-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
@@ -1240,11 +1240,18 @@ class Database:
|
|
|
1240
1240
|
edge collection), "from" (list of vertex collection names) and "to"
|
|
1241
1241
|
(list of vertex collection names).
|
|
1242
1242
|
is_disjoint (bool | None): Whether to create a Disjoint SmartGraph
|
|
1243
|
-
instead of a regular SmartGraph
|
|
1244
|
-
|
|
1245
|
-
|
|
1243
|
+
instead of a regular SmartGraph. Only has an effect with
|
|
1244
|
+
`smart_graph_attribute` or `is_smart` (Enterprise Edition only).
|
|
1245
|
+
Deprecated: use `GraphOptions.is_disjoint` instead.
|
|
1246
|
+
is_smart (bool | None): If `True`, create a SmartGraph when
|
|
1247
|
+
`options.smart_graph_attribute` is set, or an EnterpriseGraph
|
|
1248
|
+
otherwise. Ignored for SatelliteGraphs (Enterprise Edition only).
|
|
1249
|
+
Deprecated: use `GraphOptions.is_smart` instead.
|
|
1246
1250
|
options (GraphOptions | dict | None): Options for creating collections
|
|
1247
|
-
within this graph.
|
|
1251
|
+
within this graph. Setting `smart_graph_attribute` creates a
|
|
1252
|
+
SmartGraph even if `is_smart` is omitted or `False`. Explicit
|
|
1253
|
+
`is_smart` and `is_disjoint` arguments override the corresponding
|
|
1254
|
+
entries in these options.
|
|
1248
1255
|
orphan_collections (list | None): An array of additional vertex
|
|
1249
1256
|
collections. Documents in these collections do not have edges
|
|
1250
1257
|
within this graph.
|
|
@@ -1260,6 +1267,15 @@ class Database:
|
|
|
1260
1267
|
References:
|
|
1261
1268
|
- `create-a-graph <https://docs.arango.ai/arangodb/stable/develop/http-api/graphs/named-graphs/#create-a-graph>`__
|
|
1262
1269
|
""" # noqa: E501
|
|
1270
|
+
if is_smart is not None or is_disjoint is not None:
|
|
1271
|
+
warn(
|
|
1272
|
+
"The separate is_smart and is_disjoint arguments are deprecated; "
|
|
1273
|
+
"pass these flags through GraphOptions or the options "
|
|
1274
|
+
"dictionary instead.",
|
|
1275
|
+
DeprecationWarning,
|
|
1276
|
+
stacklevel=2,
|
|
1277
|
+
)
|
|
1278
|
+
|
|
1263
1279
|
params: Params = {}
|
|
1264
1280
|
if wait_for_sync is not None:
|
|
1265
1281
|
params["waitForSync"] = wait_for_sync
|
|
@@ -1267,15 +1283,15 @@ class Database:
|
|
|
1267
1283
|
data: Json = {"name": name}
|
|
1268
1284
|
if edge_definitions is not None:
|
|
1269
1285
|
data["edgeDefinitions"] = edge_definitions
|
|
1270
|
-
if is_disjoint is not None:
|
|
1271
|
-
data["isDisjoint"] = is_disjoint
|
|
1272
|
-
if is_smart is not None:
|
|
1273
|
-
data["isSmart"] = is_smart
|
|
1274
1286
|
if options is not None:
|
|
1275
1287
|
if isinstance(options, GraphOptions):
|
|
1276
|
-
data["options"] = options.to_dict()
|
|
1288
|
+
data["options"] = options.to_dict().copy()
|
|
1277
1289
|
else:
|
|
1278
|
-
data["options"] = options
|
|
1290
|
+
data["options"] = options.copy()
|
|
1291
|
+
if is_disjoint is not None:
|
|
1292
|
+
data.setdefault("options", {})["isDisjoint"] = is_disjoint
|
|
1293
|
+
if is_smart is not None:
|
|
1294
|
+
data.setdefault("options", {})["isSmart"] = is_smart
|
|
1279
1295
|
if orphan_collections is not None:
|
|
1280
1296
|
data["orphanCollections"] = orphan_collections
|
|
1281
1297
|
|
|
@@ -87,10 +87,11 @@ class Graph(Generic[T, U, V]):
|
|
|
87
87
|
"""Get the properties of the graph.
|
|
88
88
|
|
|
89
89
|
Returns:
|
|
90
|
-
GraphProperties: Properties of the graph
|
|
90
|
+
GraphProperties: Properties of the graph, including `is_smart`,
|
|
91
|
+
`is_disjoint`, and `smart_graph_attribute`.
|
|
91
92
|
|
|
92
93
|
Raises:
|
|
93
|
-
|
|
94
|
+
GraphPropertiesError: If the operation fails.
|
|
94
95
|
|
|
95
96
|
References:
|
|
96
97
|
- `get-a-graph <https://docs.arango.ai/arangodb/stable/develop/http-api/graphs/named-graphs/#get-a-graph>`__
|
|
@@ -1873,6 +1873,16 @@ class GraphProperties(JsonWrapper):
|
|
|
1873
1873
|
"""Check if the graph is a smart graph."""
|
|
1874
1874
|
return cast(bool, self._data.get("isSmart", False))
|
|
1875
1875
|
|
|
1876
|
+
@property
|
|
1877
|
+
def is_disjoint(self) -> bool:
|
|
1878
|
+
"""Check if the graph is a Disjoint SmartGraph."""
|
|
1879
|
+
return cast(bool, self._data.get("isDisjoint", False))
|
|
1880
|
+
|
|
1881
|
+
@property
|
|
1882
|
+
def smart_graph_attribute(self) -> Optional[str]:
|
|
1883
|
+
"""Return the sharding attribute for a SmartGraph, if present."""
|
|
1884
|
+
return cast(Optional[str], self._data.get("smartGraphAttribute"))
|
|
1885
|
+
|
|
1876
1886
|
@property
|
|
1877
1887
|
def is_satellite(self) -> bool:
|
|
1878
1888
|
"""Check if the graph is a satellite graph."""
|
|
@@ -1963,6 +1973,10 @@ class GraphOptions(JsonWrapper):
|
|
|
1963
1973
|
Enterprise Edition.
|
|
1964
1974
|
write_concern (int | None): The write concern for new collections in the
|
|
1965
1975
|
graph.
|
|
1976
|
+
is_smart (bool | None): Create a SmartGraph when `smart_graph_attribute`
|
|
1977
|
+
is set, or an EnterpriseGraph otherwise. Ignored for SatelliteGraphs.
|
|
1978
|
+
is_disjoint (bool | None): Create a Disjoint SmartGraph. Only has an
|
|
1979
|
+
effect with `smart_graph_attribute` or `is_smart`.
|
|
1966
1980
|
|
|
1967
1981
|
References:
|
|
1968
1982
|
- `create-a-graph <https://docs.arango.ai/arangodb/stable/develop/http-api/graphs/named-graphs/#create-a-graph>`__
|
|
@@ -1975,6 +1989,8 @@ class GraphOptions(JsonWrapper):
|
|
|
1975
1989
|
satellites: Optional[List[str]] = None,
|
|
1976
1990
|
smart_graph_attribute: Optional[str] = None,
|
|
1977
1991
|
write_concern: Optional[int] = None,
|
|
1992
|
+
is_smart: Optional[bool] = None,
|
|
1993
|
+
is_disjoint: Optional[bool] = None,
|
|
1978
1994
|
) -> None:
|
|
1979
1995
|
data: Json = dict()
|
|
1980
1996
|
if number_of_shards is not None:
|
|
@@ -1987,8 +2003,20 @@ class GraphOptions(JsonWrapper):
|
|
|
1987
2003
|
data["smartGraphAttribute"] = smart_graph_attribute
|
|
1988
2004
|
if write_concern is not None:
|
|
1989
2005
|
data["writeConcern"] = write_concern
|
|
2006
|
+
if is_smart is not None:
|
|
2007
|
+
data["isSmart"] = is_smart
|
|
2008
|
+
if is_disjoint is not None:
|
|
2009
|
+
data["isDisjoint"] = is_disjoint
|
|
1990
2010
|
super().__init__(data)
|
|
1991
2011
|
|
|
2012
|
+
@property
|
|
2013
|
+
def is_smart(self) -> Optional[bool]:
|
|
2014
|
+
return cast(Optional[bool], self._data.get("isSmart"))
|
|
2015
|
+
|
|
2016
|
+
@property
|
|
2017
|
+
def is_disjoint(self) -> Optional[bool]:
|
|
2018
|
+
return cast(Optional[bool], self._data.get("isDisjoint"))
|
|
2019
|
+
|
|
1992
2020
|
@property
|
|
1993
2021
|
def number_of_shards(self) -> Optional[int]:
|
|
1994
2022
|
return cast(int, self._data.get("numberOfShards"))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.7"
|
|
@@ -42,6 +42,45 @@ For more information, refer to `ArangoDB Manual`_.
|
|
|
42
42
|
# Delete the graph.
|
|
43
43
|
await db.delete_graph("school")
|
|
44
44
|
|
|
45
|
+
Graph creation options
|
|
46
|
+
======================
|
|
47
|
+
|
|
48
|
+
Pass ``GraphOptions(is_smart=True)`` as ``options`` to create an EnterpriseGraph
|
|
49
|
+
without a user-defined sharding attribute. Set ``GraphOptions.smart_graph_attribute``
|
|
50
|
+
to create a SmartGraph; ``is_smart=True`` is then optional. Every vertex must
|
|
51
|
+
contain the named attribute.
|
|
52
|
+
|
|
53
|
+
Set ``is_disjoint=True`` in ``GraphOptions`` with a smart graph attribute to create
|
|
54
|
+
a Disjoint SmartGraph, which rejects edges between vertices with different
|
|
55
|
+
attribute values.
|
|
56
|
+
For example, on an Enterprise cluster:
|
|
57
|
+
|
|
58
|
+
.. code-block:: python
|
|
59
|
+
|
|
60
|
+
from arangoasync.typings import GraphOptions
|
|
61
|
+
|
|
62
|
+
regional = await db.create_graph(
|
|
63
|
+
"regional",
|
|
64
|
+
edge_definitions=[{
|
|
65
|
+
"collection": "routes",
|
|
66
|
+
"from": ["places"],
|
|
67
|
+
"to": ["places"],
|
|
68
|
+
}],
|
|
69
|
+
options=GraphOptions(
|
|
70
|
+
number_of_shards=3,
|
|
71
|
+
smart_graph_attribute="region",
|
|
72
|
+
is_disjoint=True,
|
|
73
|
+
),
|
|
74
|
+
)
|
|
75
|
+
properties = await regional.properties()
|
|
76
|
+
assert properties.is_disjoint is True
|
|
77
|
+
assert properties.smart_graph_attribute == "region"
|
|
78
|
+
|
|
79
|
+
The separate ``create_graph(is_smart=..., is_disjoint=...)`` arguments are
|
|
80
|
+
deprecated. Pass these flags through ``GraphOptions`` or a raw ``options``
|
|
81
|
+
dictionary instead. Existing separate arguments still take precedence over
|
|
82
|
+
matching entries in ``options``, including explicit ``False`` values.
|
|
83
|
+
|
|
45
84
|
.. _edge-definitions:
|
|
46
85
|
|
|
47
86
|
Edge Definitions
|
|
@@ -76,7 +76,7 @@ on fields ``_from`` and ``_to``. For more information on indexes, refer to
|
|
|
76
76
|
},
|
|
77
77
|
)
|
|
78
78
|
|
|
79
|
-
# Index creation may succeed even if
|
|
79
|
+
# Index creation may succeed even if there is insufficient training data.
|
|
80
80
|
if vector_index.training_state != "ready":
|
|
81
81
|
raise RuntimeError(
|
|
82
82
|
vector_index.error_message or "Vector index is not ready"
|
|
@@ -86,7 +86,10 @@ Omitted or scaling-object ``nLists``, ``numberOfDocsPerCentroid``, factory
|
|
|
86
86
|
placeholders such as ``IVF{},Flat``, and successful-but-unusable creation
|
|
87
87
|
behavior require ArangoDB 3.12.10 or later. A successful creation response
|
|
88
88
|
means that the index exists, but callers should check ``training_state`` before
|
|
89
|
-
using it. If
|
|
90
|
-
``error_message`` describes the failure.
|
|
89
|
+
using it. If there is insufficient data to train the index, the state is
|
|
90
|
+
``"unusable"`` and ``error_message`` describes the failure. Invalid index
|
|
91
|
+
definitions, such as an ``nLists`` value that disagrees with the number of
|
|
92
|
+
centroids in the factory string, are rejected during creation with
|
|
93
|
+
``IndexCreateError`` and no index is created.
|
|
91
94
|
|
|
92
95
|
See :class:`arangoasync.collection.StandardCollection` for API specification.
|
{python_arango_async-1.2.5 → python_arango_async-1.2.7}/python_arango_async.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-arango-async
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.7
|
|
4
4
|
Summary: Async Python Driver for ArangoDB
|
|
5
5
|
Author-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
6
6
|
Maintainer-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
3
|
# Starts a local ArangoDB server or cluster (community or enterprise).
|
|
4
|
-
# Useful for testing the python-arango driver against a local ArangoDB setup.
|
|
4
|
+
# Useful for testing the python-arango-async driver against a local ArangoDB setup.
|
|
5
5
|
|
|
6
6
|
# Usage:
|
|
7
7
|
# ./starter.sh [single|cluster] [community|enterprise|enterprise-preview] [version]
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
# ./starter.sh cluster enterprise 3.12.4
|
|
11
11
|
# ./starter.sh single enterprise-preview 4.0-nightly
|
|
12
12
|
# ./starter.sh single arangodb/enterprise-preview:4.0-nightly
|
|
13
|
+
# Defaults: single server, enterprise image, latest version.
|
|
13
14
|
|
|
14
15
|
setup="${1:-single}"
|
|
15
|
-
image="${2:-
|
|
16
|
+
image="${2:-enterprise}"
|
|
16
17
|
version="${3:-latest}"
|
|
17
18
|
|
|
18
19
|
extra_ports=""
|
|
@@ -52,8 +52,8 @@ async def test_simple_query(db, bad_db, doc_col, docs):
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
@pytest.mark.asyncio
|
|
55
|
-
async def test_query_tracking(
|
|
56
|
-
aql =
|
|
55
|
+
async def test_query_tracking(sys_db, bad_db):
|
|
56
|
+
aql = sys_db.aql
|
|
57
57
|
|
|
58
58
|
# Get the current tracking properties.
|
|
59
59
|
tracking = await aql.tracking()
|
|
@@ -337,24 +337,6 @@ async def test_collection_index(doc_col, bad_col, cluster, db_version):
|
|
|
337
337
|
await doc_col.delete_index(default_index.id)
|
|
338
338
|
await doc_col.delete_index(scaling_index.id)
|
|
339
339
|
|
|
340
|
-
# A permanent training failure still creates an unusable index.
|
|
341
|
-
unusable_index = await doc_col.add_index(
|
|
342
|
-
"vector",
|
|
343
|
-
["embedding1"],
|
|
344
|
-
{
|
|
345
|
-
"name": "vector_index_unusable",
|
|
346
|
-
"params": {
|
|
347
|
-
"metric": "cosine",
|
|
348
|
-
"dimension": 128,
|
|
349
|
-
"nLists": 2,
|
|
350
|
-
"factory": "IVF3,Flat",
|
|
351
|
-
},
|
|
352
|
-
},
|
|
353
|
-
)
|
|
354
|
-
assert unusable_index.training_state == "unusable"
|
|
355
|
-
assert unusable_index.error_message
|
|
356
|
-
await doc_col.delete_index(unusable_index.id)
|
|
357
|
-
|
|
358
340
|
# Invalid requests continue to fail at the HTTP layer.
|
|
359
341
|
with pytest.raises(IndexCreateError) as err:
|
|
360
342
|
await doc_col.add_index(
|
|
@@ -378,6 +360,30 @@ async def test_collection_index(doc_col, bad_col, cluster, db_version):
|
|
|
378
360
|
assert await doc_col.delete_index(idx2.id, ignore_missing=True) is False
|
|
379
361
|
|
|
380
362
|
|
|
363
|
+
@pytest.mark.asyncio
|
|
364
|
+
async def test_unusable_vector_index(doc_col, db_version):
|
|
365
|
+
if db_version < version.parse("3.12.10"):
|
|
366
|
+
pytest.skip("Unusable vector index test requires ArangoDB 3.12.10+")
|
|
367
|
+
|
|
368
|
+
# One training vector is insufficient for two centroids.
|
|
369
|
+
await doc_col.insert({"embedding": [1.0, 1.0]})
|
|
370
|
+
index = await doc_col.add_index(
|
|
371
|
+
"vector",
|
|
372
|
+
["embedding"],
|
|
373
|
+
{
|
|
374
|
+
"name": "vector_index_unusable",
|
|
375
|
+
"params": {
|
|
376
|
+
"metric": "cosine",
|
|
377
|
+
"dimension": 2,
|
|
378
|
+
"nLists": 2,
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
)
|
|
382
|
+
assert index.training_state == "unusable"
|
|
383
|
+
assert index.error_message
|
|
384
|
+
await doc_col.delete_index(index.id)
|
|
385
|
+
|
|
386
|
+
|
|
381
387
|
@pytest.mark.asyncio
|
|
382
388
|
async def test_collection_truncate_count(docs, doc_col, bad_col):
|
|
383
389
|
# Test errors
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
|
+
from arangoasync.errno import INVALID_DISJOINT_SMART_EDGE
|
|
3
4
|
from arangoasync.exceptions import (
|
|
4
5
|
DocumentDeleteError,
|
|
6
|
+
DocumentInsertError,
|
|
5
7
|
EdgeCollectionListError,
|
|
6
8
|
EdgeDefinitionDeleteError,
|
|
7
9
|
EdgeDefinitionListError,
|
|
@@ -19,6 +21,80 @@ from arangoasync.typings import GraphOptions
|
|
|
19
21
|
from tests.helpers import generate_col_name, generate_graph_name
|
|
20
22
|
|
|
21
23
|
|
|
24
|
+
@pytest.mark.asyncio
|
|
25
|
+
@pytest.mark.parametrize("creation_api", ["options", "legacy"])
|
|
26
|
+
@pytest.mark.parametrize(
|
|
27
|
+
"smart_field,disjoint",
|
|
28
|
+
[(None, False), ("region", False), ("region", True)],
|
|
29
|
+
ids=["enterprise", "smart", "disjoint-smart"],
|
|
30
|
+
)
|
|
31
|
+
async def test_graph_create_smart_options(
|
|
32
|
+
db, cluster, skip_tests, smart_field, disjoint, creation_api
|
|
33
|
+
):
|
|
34
|
+
if "enterprise" in skip_tests:
|
|
35
|
+
pytest.skip("Only for ArangoDB enterprise edition")
|
|
36
|
+
if not cluster:
|
|
37
|
+
pytest.skip("Only for ArangoDB clusters")
|
|
38
|
+
|
|
39
|
+
# Create an EnterpriseGraph, SmartGraph, or Disjoint SmartGraph.
|
|
40
|
+
graph_name = generate_graph_name()
|
|
41
|
+
vertices = generate_col_name()
|
|
42
|
+
edges = generate_col_name()
|
|
43
|
+
options = GraphOptions(
|
|
44
|
+
number_of_shards=3,
|
|
45
|
+
smart_graph_attribute=smart_field,
|
|
46
|
+
is_smart=True,
|
|
47
|
+
is_disjoint=disjoint,
|
|
48
|
+
)
|
|
49
|
+
kwargs = {}
|
|
50
|
+
if creation_api == "legacy":
|
|
51
|
+
options = GraphOptions(
|
|
52
|
+
number_of_shards=3,
|
|
53
|
+
smart_graph_attribute=smart_field,
|
|
54
|
+
is_smart=False,
|
|
55
|
+
is_disjoint=not disjoint,
|
|
56
|
+
)
|
|
57
|
+
kwargs = {"is_smart": True, "is_disjoint": disjoint}
|
|
58
|
+
original_options = options.to_dict().copy()
|
|
59
|
+
graph = await db.create_graph(
|
|
60
|
+
graph_name,
|
|
61
|
+
edge_definitions=[{"collection": edges, "from": [vertices], "to": [vertices]}],
|
|
62
|
+
options=options,
|
|
63
|
+
**kwargs,
|
|
64
|
+
)
|
|
65
|
+
try:
|
|
66
|
+
assert options.to_dict() == original_options
|
|
67
|
+
# Check that the server honored the graph creation options.
|
|
68
|
+
properties = await graph.properties()
|
|
69
|
+
assert properties.is_smart is True
|
|
70
|
+
assert properties.is_disjoint is disjoint
|
|
71
|
+
assert (properties.smart_graph_attribute or "") == (smart_field or "")
|
|
72
|
+
assert properties.number_of_shards == 3
|
|
73
|
+
|
|
74
|
+
# Add two vertices in one region and a third in another.
|
|
75
|
+
first = await graph.insert_vertex(vertices, {"region": "eu"})
|
|
76
|
+
second = await graph.insert_vertex(vertices, {"region": "eu"})
|
|
77
|
+
third = await graph.insert_vertex(vertices, {"region": "us"})
|
|
78
|
+
# All three graph types must allow edges within a region.
|
|
79
|
+
edge = await graph.insert_edge(
|
|
80
|
+
edges, {"_from": first["_id"], "_to": second["_id"]}
|
|
81
|
+
)
|
|
82
|
+
assert await graph.has_edge(edge["_id"])
|
|
83
|
+
|
|
84
|
+
# Only the disjoint graph must reject edges between regions.
|
|
85
|
+
cross_region_edge = {"_from": first["_id"], "_to": third["_id"]}
|
|
86
|
+
if disjoint:
|
|
87
|
+
with pytest.raises(DocumentInsertError) as err:
|
|
88
|
+
await graph.insert_edge(edges, cross_region_edge)
|
|
89
|
+
assert err.value.error_code == INVALID_DISJOINT_SMART_EDGE
|
|
90
|
+
else:
|
|
91
|
+
edge = await graph.insert_edge(edges, cross_region_edge)
|
|
92
|
+
assert await graph.has_edge(edge["_id"])
|
|
93
|
+
finally:
|
|
94
|
+
# Remove the graph and its collections even if an assertion fails.
|
|
95
|
+
await db.delete_graph(graph_name, drop_collections=True)
|
|
96
|
+
|
|
97
|
+
|
|
22
98
|
@pytest.mark.asyncio
|
|
23
99
|
async def test_graph_basic(db, bad_db):
|
|
24
100
|
graph1_name = generate_graph_name()
|
|
@@ -60,8 +136,8 @@ async def test_graph_properties(db, bad_graph, cluster, skip_tests):
|
|
|
60
136
|
# Create a graph
|
|
61
137
|
name = generate_graph_name()
|
|
62
138
|
is_smart = cluster and "enterprise" not in skip_tests
|
|
63
|
-
options = GraphOptions(number_of_shards=3)
|
|
64
|
-
graph = await db.create_graph(name,
|
|
139
|
+
options = GraphOptions(number_of_shards=3, is_smart=is_smart)
|
|
140
|
+
graph = await db.create_graph(name, options=options)
|
|
65
141
|
|
|
66
142
|
with pytest.raises(GraphPropertiesError):
|
|
67
143
|
await bad_graph.properties()
|
|
@@ -358,6 +358,17 @@ def test_GraphProperties():
|
|
|
358
358
|
]
|
|
359
359
|
assert graph_properties.orphan_collections == ["orphan1", "orphan2"]
|
|
360
360
|
|
|
361
|
+
for is_disjoint in (False, True):
|
|
362
|
+
properties = GraphProperties(
|
|
363
|
+
{"isDisjoint": is_disjoint, "smartGraphAttribute": "region"}
|
|
364
|
+
)
|
|
365
|
+
assert properties.is_disjoint is is_disjoint
|
|
366
|
+
assert properties.smart_graph_attribute == "region"
|
|
367
|
+
|
|
368
|
+
properties = GraphProperties({})
|
|
369
|
+
assert properties.is_disjoint is False
|
|
370
|
+
assert properties.smart_graph_attribute is None
|
|
371
|
+
|
|
361
372
|
|
|
362
373
|
def test_GraphOptions():
|
|
363
374
|
graph_options = GraphOptions(
|
|
@@ -374,6 +385,18 @@ def test_GraphOptions():
|
|
|
374
385
|
assert graph_options.smart_graph_attribute == "region"
|
|
375
386
|
assert graph_options.write_concern == 1
|
|
376
387
|
|
|
388
|
+
for flag in (False, True):
|
|
389
|
+
options = GraphOptions(is_smart=flag, is_disjoint=flag)
|
|
390
|
+
assert options.is_smart is flag
|
|
391
|
+
assert options.is_disjoint is flag
|
|
392
|
+
assert options.to_dict() == {"isSmart": flag, "isDisjoint": flag}
|
|
393
|
+
|
|
394
|
+
options = GraphOptions()
|
|
395
|
+
assert options.is_smart is None
|
|
396
|
+
assert options.is_disjoint is None
|
|
397
|
+
assert "isSmart" not in options
|
|
398
|
+
assert "isDisjoint" not in options
|
|
399
|
+
|
|
377
400
|
|
|
378
401
|
def test_VertexCollectionOptions():
|
|
379
402
|
options = VertexCollectionOptions(
|
|
@@ -4,6 +4,7 @@ from arangoasync.auth import Auth
|
|
|
4
4
|
from arangoasync.errno import USER_NOT_FOUND
|
|
5
5
|
from arangoasync.exceptions import (
|
|
6
6
|
CollectionCreateError,
|
|
7
|
+
CollectionListError,
|
|
7
8
|
DocumentInsertError,
|
|
8
9
|
PermissionResetError,
|
|
9
10
|
PermissionUpdateError,
|
|
@@ -176,6 +177,14 @@ async def test_user_change_permissions(sys_db, arango_client, db):
|
|
|
176
177
|
with pytest.raises(PermissionResetError):
|
|
177
178
|
await db.reset_permission(username, db.name)
|
|
178
179
|
await sys_db.reset_permission(username, db.name)
|
|
180
|
+
assert await sys_db.permission(username, db.name) == "none"
|
|
181
|
+
# ArangoDB 4.0 returns 403 where earlier versions returned 401.
|
|
182
|
+
with pytest.raises(CollectionCreateError) as err:
|
|
183
|
+
await db2.create_collection(generate_col_name())
|
|
184
|
+
assert err.value.http_code in {401, 403}
|
|
185
|
+
with pytest.raises(CollectionListError) as err:
|
|
186
|
+
await db2.collections()
|
|
187
|
+
assert err.value.http_code in {401, 403}
|
|
179
188
|
with pytest.raises(DocumentInsertError):
|
|
180
189
|
await col.insert({"_key": "test"})
|
|
181
190
|
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
name: Upload to PyPI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types: [published]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
upload:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
|
|
11
|
-
steps:
|
|
12
|
-
- name: Checkout repository
|
|
13
|
-
uses: actions/checkout@v7
|
|
14
|
-
with:
|
|
15
|
-
fetch-depth: 0
|
|
16
|
-
fetch-tags: true
|
|
17
|
-
|
|
18
|
-
- uses: actions/setup-python@v7
|
|
19
|
-
with:
|
|
20
|
-
python-version: "3.12"
|
|
21
|
-
|
|
22
|
-
- name: Install build dependencies
|
|
23
|
-
run: |
|
|
24
|
-
python -m pip install --upgrade pip
|
|
25
|
-
pip install build twine
|
|
26
|
-
|
|
27
|
-
- name: Build package
|
|
28
|
-
run: python -m build
|
|
29
|
-
|
|
30
|
-
- name: Publish to PyPI Test
|
|
31
|
-
env:
|
|
32
|
-
TWINE_USERNAME: __token__
|
|
33
|
-
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
|
|
34
|
-
run: twine upload --verbose --repository testpypi dist/*
|
|
35
|
-
|
|
36
|
-
- name: Publish to PyPI
|
|
37
|
-
env:
|
|
38
|
-
TWINE_USERNAME: __token__
|
|
39
|
-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
40
|
-
run: twine upload --verbose --repository pypi dist/*
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
|
|
3
|
-
Set up dev environment:
|
|
4
|
-
```shell
|
|
5
|
-
cd ~/your/repository/fork # Activate venv if you have one (recommended)
|
|
6
|
-
pip install -e .[dev] # Install dev dependencies (e.g. black, mypy, pre-commit)
|
|
7
|
-
pre-commit install # Install git pre-commit hooks
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
Run unit tests with coverage:
|
|
11
|
-
|
|
12
|
-
```shell
|
|
13
|
-
pytest --cluster --cov=arango --cov-report=html # Open htmlcov/index.html in your browser
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
To start and ArangoDB instance locally, run:
|
|
17
|
-
|
|
18
|
-
```shell
|
|
19
|
-
./starter.sh # Requires docker
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Build and test documentation:
|
|
23
|
-
|
|
24
|
-
```shell
|
|
25
|
-
python -m sphinx docs docs/_build # Open docs/_build/index.html in your browser
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Thank you for your contribution!
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.2.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_arango_async-1.2.5 → python_arango_async-1.2.7}/python_arango_async.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_arango_async-1.2.5 → python_arango_async-1.2.7}/python_arango_async.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|