Repository navigation
fix: take a relative database path from Python's current directory - #518
Merged
Merged
Conversation
… directory CI evidence first: the engine seems to resolve part of the files of a relative path against the directory it started in (FileManager opens component files by File.getAbsolutePath(), which reads the cached user.dir, while File.exists() and mkdirs() follow the process's current directory). These tests fail on the current bindings if that is so.
The engine resolves a part of the files of a relative path against the directory it started in (Java reads user.dir once; DatabaseFactory.getNormalizedPath and FileManager use it) and the rest against the current directory of the process, so after os.chdir one relative path named two directories. CI showed it on both packages at a7d444a: six of the new tests failed. DatabaseFactory (both builds) and ArcadeDBServer now make the path absolute before the engine sees it; an absolute path is passed unchanged. get_database_path() and error messages therefore show the absolute path. Closes #521
The absolute-path step called os.fspath, which does not take a java.lang.String; test_arrow_vector_column_jvm reopens a database with the string that getDatabasePath() returned (6 failures on the JVM build in CI).
This was referenced Nov 27, 2026
Merged
Open
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.
What does this PR do?
A relative database path is now taken from Python's current directory, also after
os.chdir. Before, the engine resolved a part of it against the directory it had started in.os.chdiropen_or_create_database("db"), thendatabase_exists("db")FalseTruedbfrom another directory while the first is openArcadeDBServer(root_path="./server_root"), change directory, startDatabaseFactory(and socreate_database,open_database,open_or_create_database, anddatabase_exists) andArcadeDBServermake the path absolute before the engine sees it, in both packages. An absolute path is passed on unchanged.create_serveralready did this for its root, andimport_documentsandexport_databasealready followed the current directory (their tests passed on the old code), so they are not changed.Behaviour change: for a relative path,
db.get_database_path()and the engine's error messages now show the absolute path. A factory or a server keeps the directory that was current when it was made.Related issues
Closes #521
Performance changes
None.
Docs
agent-memory.adocno longer asks for an absolute path afteros.chdir,databases-and-queries.adocstates the rule and shows the new output, andupgrading.adoclists the changed behaviour. The two changed output lines of the databases page are edited by hand: no test runs that page.Checklist
tests/test_relative_paths.py: ata7d444a, which holds only the tests, six of them failed onarcadedb-jvmwith Python 3.14 and onarcadedbwith Python 3.12; the pass is the checks of this pull request)The first run of the fix also showed that a Java string returned by
getDatabasePath()was no longer accepted as a path; the second commit keeps it working.uvx pre-commit run --files <changed files>passes