Repository navigation
native: float64 arrays keep their doubles; to_json_list epoch millis floor in integer arithmetic - #176
Merged
Conversation
…arithmetic A1: a float64 ndarray bound by name, inside CONTENT :row or set on a record went through the float32 side buffer in binary mode (and the "F" tag, a float[] in Java, in text mode), so 0.1 was stored as 0.10000000149011612 while the JVM build stores the double. Only float32 arrays take the side buffer now; any other float array is its tolist(). A float array among the positional parameters stays a query vector sent as float32 (encode_params narrows it first, as Database._convert_args does on the JVM build), as documented. C1: json_native computed epoch milliseconds as int(total_seconds() * 1000), which rounds toward zero before 1970, rolled 9999-12-31 23:59:59.999999 into year 10000 and could land 1 ms low on exact milliseconds. Integer days/seconds/ microseconds arithmetic, floored like Instant.toEpochMilli. Tests are shared by both builds. Docs: the query vector note now says named, CONTENT and record float64 arrays keep their doubles on both builds. Against the main 26.11.1.dev0 wheels the native wheel fails the three float64 tests and the DATETIME_MICROS epoch test and the JVM wheel passes all nine. Closes #175 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tae898
added a commit
that referenced
this pull request
Nov 1, 2026
…after DROP INDEX (#186) (#187) The query-vector list bullet said a float64 array crosses as one buffer on the JVM build with no value change; since #176 a positional float64 array is narrowed to float32 on both builds (the next bullet). The vectors page now says what #166 made true on both builds: held index reads ask the engine, raise with the index name after DROP INDEX, and report a re-created index's own configuration. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #175
src/arcadedb/_native/codec.py: only float32 arrays take the float32 side buffer (binary mode) or theFtag; any other float array is sent as its doubles (tolist(), asrow_defaultalready did forinsert_many). A float array as a positional?is still narrowed to float32 (new_query_vector()), the documented query-vector rule that the JVM build applies too. Epoch milliseconds into_json_listuse integer arithmetic that floors (_epoch_millis), likeInstant.toEpochMillion the JVM side, for DATETIME, DATE and tz-aware values.docs/.../how-to/databases-and-queries.adoc: the query-vector bullet now says positional float64 is float32 on both builds, while named,CONTENT :rowand record float64 keep their doubles on both builds (and that a float64 array bound by name goes as text, slower than float32).tests/test_numpy_support.py::test_float64_array_keeps_its_doubles[_write_named|_write_content_named|_write_record], float32 guards on the same paths, the positional rule;tests/test_resultset.py::test_to_json_list_datetime_is_the_floored_epoch_millis[DATETIME_MICROS|DATETIME].Verification: against the 26.11.1.dev0 wheels of main the native wheel fails the three float64 tests (
0.10000000149011612 != 0.1) and theDATETIME_MICROSepoch test (0 != -1) and passes the guards; the JVM wheel passes all nine. black, isort, pyflakes, bandit clean. The fixed native build is tested by this PR'stest-native.ymlrun.🤖 Generated with Claude Code