Skip to content

Update Python bindings for 26.8.1: server mode restored, ResultSet.to_arrow(), wire-protocol tests - #5807

Merged
robfrank merged 1 commit into
ArcadeData:mainfrom
humemai:python-bindings
Aug 4, 2026
Merged

robfrank merged 1 commit into
ArcadeData:mainfrom
humemai:python-bindings

Conversation

@tae898

@tae898 tae898 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Periodic update of bindings/python from the downstream packaging fork
(humemai/arcadedb-embedded-python), rebased on current main. No engine code.

Everything here has been shipping on PyPI as arcadedb-embedded, most recently
26.8.1, so it is running against the released engine rather than proposed
against it.

Two files outside bindings/python, and why

Both python workflows. They are in this repo because I sent them, and both
have been frozen at whatever I sent last while my copies kept gaining fixes.
Shipping tests without the workflows that run them ships tests that do not
execute.

test-python-examples.yml (+53/-10)

  • HF_HOME pinned into the workspace plus actions/cache. This matrix is 20
    jobs and the examples embed with sentence-transformers, so today it does 20
    independent model downloads per release.
  • Pre-warm with three bounded retries, continue-on-error, run separately from
    the dataset step. A transient hub outage currently fails the release, and it
    surfaces mid-example as an OSError that reads like a bindings bug. Not
    fail-fast: if the hub is genuinely down the dataset step still fails with its
    own message, so this cannot turn a real breakage into a silent skip.
  • Drops the 21_server_mode_http_access.py exclusion. That example is now
    23_server_mode_http_access.py and the CI instability it was skipped for is
    fixed, so the exclusion targets a filename that no longer exists.

test-python-bindings.yml (+31/-2)

Without it several tests in this PR do not run on your CI.

On the first push of this PR, linux/amd64 + Python 3.12 reported 405 passed,
15 skipped
. The same cell on the fork reports 423 passed, 2 skipped. The
difference is the install step:

uv pip install --system test-install/*.whl pytest pytest-cov requests numpy

No psycopg, neo4j, redis, pyarrow or pandas, so every test that
importorskips one of them skips. That included both wire-protocol tests,
which are the main thing this PR adds: test_postgres_wire_answers_a_query
and test_bolt_wire_answers_a_cypher_query both skipped, so the bundled
Postgres and Bolt plugins still had no client-level coverage here.

The change is three things:

  1. the five packages added to that install line
  2. --extra arrow --extra pandas on the dependency floor audit
  3. a guard that fails the build if any test skips for a missing import

The guard exists because this failure mode is silent by construction: a test
that skips on a missing dependency is not a pass and does not look like a
failure, so the suite goes green having exercised nothing. It matches only
could not import, so skips you legitimately expect are unaffected. Verified
against the two that remain: bindings/python/docs is not present on this branch and Requires GraphML/GraphSON support.

Happy to drop either file if you would rather own those changes separately. The
rest of the PR stands without them; those tests will just keep skipping.

Server mode is back in the wheel

create_server() / ArcadeDBServer, the HTTP API and the Studio UI ship
again, reversing the removal in 26.7.2. A downstream user reported the loss on
the removal commit itself, three weeks after it went out in a stable release,
and pinning 26.7.1 was the only way back.

Measured cost, one Linux x86_64 build of the same commit:

wheel jars bundled JRE
without server 59.06 MiB 20.70 MiB 38.30 MiB
with server 67.08 MiB 27.87 MiB 39.10 MiB
delta +8.02 MiB +7.17 MiB +0.80 MiB

Only 7.17 MiB of that is the 12 server JARs. The other 0.80 MiB is the JRE:
the build jlinks a runtime from what the shipped JARs need, and the server
pulls in java.naming, java.security.jgss and java.security.sasl.

The bundled wire protocols now have tests that speak them

arcadedb-postgresw, arcadedb-redisw and arcadedb-bolt were in the wheel
with nothing connecting over any of them. The suite covered lifecycle,
threading and JAR presence, which is the same shape as shipping a feature and
testing that its file exists.

tests/test_server_wire_protocols.py connects with the real clients
(psycopg, neo4j), because the failure worth catching is not "the port is
closed" but "the plugin loaded and then disagreed with its own client". It
also pins that the plugins are opt-in, so the other tests keep meaning
something if that default ever changes.

Writing it found #5796: arcadedb.redis.port is accepted and ignored. Redis
binds 6379 whatever you configure, while Postgres and Bolt honour theirs
through the same passthrough. ServerPlugin.configure() receives the server's
ContextConfiguration, and the Redis plugin drops the argument and reads the
static GlobalConfiguration at startService(). Bolt had the identical bug
until #3809. The test is xfail(strict=True), so it turns into a failure the
day it is fixed rather than sitting here as a permanently green skip.

New in the Python surface

  • ResultSet.to_arrow() returns a pyarrow.Table from the same columnar
    bridge buffer to_columns() already uses, so it adds no Java and no JARs.
    It preserves validity bitmaps instead of widening nullable integers to
    float64/NaN the way to_columns() must. Optional arrow extra; without
    pyarrow it returns None so callers can fall back.
  • jar_fingerprint() reports which engine an install actually carries.
    __version__ comes from the pom and says nothing about the JARs in the
    wheel, and the two can disagree with no error at all. It returns both a
    build hash and an engine_sha256 that excludes the bridge JAR I compile,
    since that one is not byte reproducible.
  • DocumentBatcher / TimeSeriesBatcher under src/java, for bulk paths
    that would otherwise cross the boundary per row.

Binding changes the engine required

Testing

423 passed, 2 skipped, 1 xfailed on linux/amd64, Python 3.12, against a wheel
built from this tree. The two skips are GraphML/GraphSON, genuinely absent
because the Gremlin JAR is excluded; the xfail is #5796 above.

Optional test dependencies are named explicitly in the test extra now.
pandas had never been there, so both to_dataframe() tests called
importorskip and skipped in every CI run this package has had, for a public
documented method. They pass once pandas is installed, so it was a coverage
gap rather than a bug, which is also why nobody noticed.

@mergify

mergify Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@codacy-production

codacy-production Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 critical · 32 high · 2 medium · 64 minor

Alerts:
⚠ 100 issues (≤ 0 issues of at least minor severity)

Results:
100 new issues

Category Results
UnusedCode 1 minor
Documentation 60 minor
ErrorProne 1 high
Security 2 critical
31 high
CodeStyle 3 minor
Complexity 2 medium

View in Codacy

🟢 Metrics 304 complexity

Metric Results
Complexity 304

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@tae898
tae898 force-pushed the python-bindings branch 3 times, most recently from 82fc72a to 978c359 Compare August 4, 2026 00:16
tae898 added a commit to humemai/arcadedb-embedded-python that referenced this pull request Aug 4, 2026
Measured on PR ArcadeData#5807, linux/amd64 + Python 3.12, the same cell that gives
423 passed / 2 skipped here:

  upstream: 405 passed, 15 skipped

Their install step is 'pytest pytest-cov requests numpy' and nothing else, so
every test that importorskips psycopg, neo4j, redis, pyarrow or pandas skips
on their CI. That included BOTH wire-protocol tests, which are the headline of
that PR: the bundled Postgres and Bolt plugins finally got client-level
coverage, and upstream skipped both. Shipping tests without the workflow that
can run them ships tests that do not execute.

Our copy is upstream's plus exactly three things: the missing packages,
--extra arrow/pandas on the floor audit, and a guard that fails the build when
a test skips for a missing import. Nothing fork-specific rides along.

7 of their 15 skips are test_docs_examples.py, which is correct and stays: it
is gated on bindings/python/docs, which we deliberately do not ship, and its
reason string does not match the guard.
tae898 added a commit to humemai/arcadedb-embedded-python that referenced this pull request Aug 4, 2026
Upstream's 'setup' job runs an 'Ensure SHA pinned actions' check across every
workflow, and my test-python-examples.yml change used actions/cache@v4:

  ##[error]actions/cache@v4 is not pinned to a full length commit SHA.
  ##[error]At least one workflow or composite action contains an unpinned
           GitHub Action version.

It failed their setup gate on PR ArcadeData#5807 and cascaded: 14 jobs that depend on
setup went to 'skipping'. A real break I introduced, not analyzer noise.

Our repo does not run that check, which is exactly why it passed here and
failed there. Pinned to 0057852bfaa89a56745cba8c7296529d2fc39830 (v4.3.0),
matching the convention every other action in the file already follows
(40-char SHA + a version comment). Swept both workflows we ship: this was the
only unpinned action in either.
tae898 added a commit to humemai/arcadedb-embedded-python that referenced this pull request Aug 4, 2026
…pstream

Upstream's setup job runs pre-commit; we do not. So our formatting drifts here
and is only discovered when a bindings PR reaches them. PR ArcadeData#5807 failed their
gate twice in a row tonight, both times on something ours: first an unpinned
action, then isort and black.

Applied: black reformatted jvm.py and test_jar_provenance.py, isort fixed the
import order in __init__.py. 8 provenance tests still pass after the
reformatting.

Worth noting isort did not only move MY import. It also moved , which
has been misordered since server mode was restored, because nothing local ever
looked. That is the argument for the CI job rather than for me being more
careful: the drift predates tonight.

So lint-workflows.yml now runs pre-commit as well as the SHA-pin check, and
drops the paths filter, since formatting drift is not confined to .github.
tae898 added a commit to humemai/arcadedb-embedded-python that referenced this pull request Aug 4, 2026
…pstream

Upstream's setup job runs pre-commit; we do not. So our formatting drifts here
and is only discovered when a bindings PR reaches them. PR ArcadeData#5807 failed their
gate twice in a row tonight, both times on something ours: first an unpinned
action, then isort and black.

Applied: black reformatted jvm.py and test_jar_provenance.py, isort fixed the
import order in __init__.py. 8 provenance tests still pass after the
reformatting.

Worth noting isort did not only move MY import. It also moved the `server`
import, which has been misordered since server mode was restored, because
nothing local ever looked. That is the argument for the CI job rather than for
me being more careful: the drift predates tonight.

So lint-workflows.yml now runs pre-commit as well as the SHA-pin check, and
drops the paths filter, since formatting drift is not confined to .github.
…-04)

Regenerated by make-upstream-pr-branch.sh: bindings/python brought to the fork's main state. Scope: the minimum needed to reproduce the wheel build and run the tests and examples.
tae898 added a commit to humemai/arcadedb-embedded-python that referenced this pull request Aug 4, 2026
Upstream's setup job runs pre-commit over the tree; we never have. So the
formatting drift is not a few lines I added tonight, it is 27 files, and it
only becomes visible when a bindings PR reaches them. PR ArcadeData#5807 failed their
gate three times in a row, each time on something ours and each time on
something the previous fix had not reached: an unpinned action, then isort on
one file, then black across files I had never touched.

Applied to bindings/python only. Full suite still 423 passed, 2 skipped,
1 xfailed afterwards, so this is formatting and nothing else.

The CI job is scoped the same way rather than --all-files. Repo-wide,
end-of-file-fixer rewrites 400+ raw result JSONs under
benchmarks/experiments/results/ to add trailing newlines, and a formatter that
edits recorded measurements is a bad idea regardless of how harmless the edit
is. bindings/python is also precisely the surface upstream receives, so the job
answers the question that actually bites: would our next PR pass their gate.
@robfrank
robfrank merged commit 0ec2803 into ArcadeData:main Aug 4, 2026
61 of 66 checks passed
tae898 added a commit to humemai/arcadedb-embedded-python that referenced this pull request Aug 11, 2026
Brings the fork up to 26.9.1-SNAPSHOT, which carries the August fixes we
filed: ArcadeData#5711 (HTTP row truncation), ArcadeData#5745/ArcadeData#5788 (GAV), ArcadeData#5746 (Cypher through
GAVFusedChain), ArcadeData#5747 (close-time HNSW rebuild, our PR ArcadeData#5787), ArcadeData#5796 (Redis
port), ArcadeData#5824 (@Rid IN replanned as FETCH FROM RIDs). All verified against
the shipped jars before this merge.

Conflicts resolved:
- 15 .github files kept deleted. Upstream CI the fork does not run; we carry
  only the five Python workflows.
- test-python-examples.yml took upstream's two dependabot SHA bumps
  (setup-java v5.6.0 -> v5.7.0, cache v4.3.0 -> v6.1.0), staying aligned
  with the SHA-pinning their review requires.
- test_server_wire_protocols.py kept ours. Upstream carries the version from
  PR ArcadeData#5807, which still has the redis xfail; ArcadeData#5796 is fixed and the marker
  was retired in a5d82c0.

Behaviour changes to watch, none of which renamed or removed a JPype-facing
API: ArcadeData#5969 now validates SQL function and method arity, ArcadeData#5908 makes sum/avg
reject non-numeric input, ArcadeData#5983 bounds regex backtracking, and ArcadeData#5786 caps
vector.neighbors groupBy output per index.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0173qFfapQBiGxaV7apSZ4X8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants