Skip to content

Return a Python str from Document.get_type_name() on arcadedb-jvm - #287

Merged
tae898 merged 1 commit into
mainfrom
fix/286-type-name-str
Nov 6, 2026
Merged

tae898 merged 1 commit into
mainfrom
fix/286-type-name-str

Conversation

@tae898

@tae898 tae898 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Closes #286

Document.get_type_name() (and so Vertex and Edge) returned a java.lang.String on arcadedb-jvm and a str on arcadedb. The Java string compares equal to a str but does not concatenate with one, so "created " + record.get_type_name() raised TypeError on the JVM build only.

I could not run the tests locally on both builds (the laptop queue guard blocks pinned local runs), so this relies on the PR's CI for arcadedb and arcadedb-jvm. Locally I ran compile(), pyflakes and the repo's pre-commit hooks on the changed files.

🤖 Generated with Claude Code

…oses #286)

getTypeName() came back as a java.lang.String on the JVM build and as a str on the native build. The Java string compares equal to a str but does not concatenate with one. Wrap it in str(); the test now asserts type is str on both builds, and the functions-and-events page loses its workaround bullet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tae898
tae898 merged commit f0d594a into main Nov 6, 2026
42 checks passed
@tae898
tae898 deleted the fix/286-type-name-str branch November 6, 2026 09:42
@github-actions github-actions Bot added this to the 26.12.1 milestone Nov 6, 2026
tae898 added a commit that referenced this pull request Nov 7, 2026
… list_vector_indexes() on arcadedb-jvm (refs #292)

The first CI run of tests/test_columnar_index.py failed on arcadedb-jvm only: Database.get_database_path() returned the raw java.lang.String of getDatabasePath(), which os.path.join refuses (TypeError: expected str, bytes or os.PathLike object, not String). The native build returns a str, so the lanes disagreed. Same family as #286 (get_type_name, fixed in #287): the binding wraps the Java getter in str().

Sweep of src/arcadedb/*.py for a method that documents a str and returns a Java getter result unconverted (an AST pass over every def annotated with str or Path, looking at what each return expression is): Database.get_name(), Database.get_database_path() and Schema.list_vector_indexes() (a list of java.lang.String). Fixed with str(). Left alone because they are documented as returning Java objects: Document.get_identity(), Schema.get_type(), get_types(), get_index_by_name(), Document.get_raw(), Result.get_raw(). Result.get_rid(), Document.get_rid(), get_type_name() and the vector index names already convert.

tests/test_str_returns.py asserts type(x) is str on both packages for the four str returns that can be read through the public API (name, path, vector index names, Result.get_rid), plus that the path joins. Nothing was run locally; CI is the first run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tae898 added a commit that referenced this pull request Nov 7, 2026
…lumnar settings (closes #292) (#300)

* Test the COLUMNAR index on both builds and document its settings (refs #292)

Why no change to reachability-metadata.json: I read every class of the engine's index/columnar and query/facet packages (26.12.1 snapshot, ArcadeData/arcadedb main 4a91847) for reflection, ServiceLoader, resources and Class.forName. There is none: the projection is plain JDK (FileChannel, VarHandle byte-array views, java.util.concurrent pools and a daemon ticker thread), the index handler is registered by instance in LocalSchema, facet.searchValues by instance in DefaultSQLFunctionFactory, and the only parser nodes the COLUMNAR and FACETS statements add are FacetsClause, FacetItem and FacetRangeItem, which PR #299 already listed. Upstream's own reachability-metadata.json lists no columnar class either. The entries upstream has and ours lacks (SQLFunctionEnsureLabelTypes, antlr StatementExpression and SubqueryExpression, three Ratis gRPC classes) are not columnar and are left for a change of their own.

Why a child process for the unclean close: DatabaseInternal.kill(), which the engine's ColumnarCrashRecoveryTest uses, is not reachable from the native package, and a JVM-only hook would not test both. A writer that ends with os._exit after its commits leaves database.lck behind and the commits in the write-ahead log, which is the state the engine's recovery reads (a crash of the process, not a power loss). Two variants: commits unflushed, and commits flushed to published segments before the rest is written.

Why no new setter for arcadedb.columnar.*: ALTER DATABASE already takes the DATABASE-scope keys (immediately, stored with the database) and refuses the JVM and SERVER ones; those are system properties through ARCADEDB_JVM_ARGS or ARCADEDB_NATIVE_ISOLATE_ARGS, as for arcadedb.fileSync. The test pins that, and that GROUP BY returns the same rows with the acceleration on and off (PROFILE names the path).

tests/test_columnar_index.py is version-gated like the smoke test (an older engine must refuse the index and the keys with its own error), runs on both packages with the public API, and polls states with deadlines. Nothing was run locally (the laptop guard blocks workloads); CI is the first run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Return a Python str from Database.get_database_path(), get_name() and list_vector_indexes() on arcadedb-jvm (refs #292)

The first CI run of tests/test_columnar_index.py failed on arcadedb-jvm only: Database.get_database_path() returned the raw java.lang.String of getDatabasePath(), which os.path.join refuses (TypeError: expected str, bytes or os.PathLike object, not String). The native build returns a str, so the lanes disagreed. Same family as #286 (get_type_name, fixed in #287): the binding wraps the Java getter in str().

Sweep of src/arcadedb/*.py for a method that documents a str and returns a Java getter result unconverted (an AST pass over every def annotated with str or Path, looking at what each return expression is): Database.get_name(), Database.get_database_path() and Schema.list_vector_indexes() (a list of java.lang.String). Fixed with str(). Left alone because they are documented as returning Java objects: Document.get_identity(), Schema.get_type(), get_types(), get_index_by_name(), Document.get_raw(), Result.get_raw(). Result.get_rid(), Document.get_rid(), get_type_name() and the vector index names already convert.

tests/test_str_returns.py asserts type(x) is str on both packages for the four str returns that can be read through the public API (name, path, vector index names, Result.get_rid), plus that the path joins. Nothing was run locally; CI is the first run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

Document.get_type_name() returns a java.lang.String on arcadedb-jvm, a str on arcadedb

1 participant