Repository navigation
Conversation
DataSource.file_content(path) returns a FileContent: HashedFileContent (sha256 + size, streamed in 1 MiB chunks from the physical file the backend's path hook declares) or UnhashedFileContent(reason). A missing file raises FileNotFoundError; a relative address is refused instead of being read from the working directory. Backends whose path hook does not name the file's own bytes answer for themselves: memory entries are objects, a Bio-Formats address is one plane inside a container, and a virtual workspace path delegates to its source backend unless it selects part of the source file. FileManager.file_content(path, backend) delegates to the source backend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Version note: 0.6.3 is taken by the arraybridge 0.5.0 migration (separate PR, merging first because OpenHCS is blocked on it). Please do not merge this PR before that one; afterwards rebase this branch onto main and release it as 0.6.4. 🤖 Generated with Claude Code |
…codec's, not a hand-written record FileContent registers its two answers under content_kind (hashed, not_hashed). to_record/from_record and the hashed flag with its hand-kept table are removed: python-introspect 0.3.0 stores a family member under its registry key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
The storage layer can now say what bytes a file holds. The backend that owns the file computes the answer; callers never hash.
polystore.file_content:FileContent(ABC) withHashedFileContent(sha256, size_bytes)andUnhashedFileContent(reason).to_record()/FileContent.from_record()round-trip through JSON; the subclass is chosen from each subclass'shashedclass attribute.DataSource.file_content(file_path)andFileManager.file_content(file_path, backend).uv.lockregenerated.What each backend answers
FileNotFoundErrorDataSource)FileManager.file_contentraisesStorageResolutionErrorNotes for review
DataSource.physical_source_pathdefaults to returning the address itself, so the memory backend would otherwise have hashed a same-named file on disk. Memory therefore overridesfile_content; a test covers this.base_pathto the path hook so a relative address stays relative and is refused, rather than being resolved against the working directory.Tests
tests/test_file_content.py(28 tests). Full suite excludingtests/integration: 629 passed, 1 skipped. Ruff on the touched files is unchanged from main (148 existing findings, none new); the new module and test file are clean.🤖 Generated with Claude Code