fix(files)!: follow the api's verbatim file external ids and deletedAt trash - #164
Merged
Merged
Conversation
…t trash The api now stores a file's external id as sent (charset-checked, looked up case-insensitively) and soft-deletes by stamping deletedAt instead of rewriting the external id to a DELETED_ tombstone. - INode gains deleted_at (Python: INode.deleted_at). - FileUpload::new defaults the external id to the file name verbatim, the server's own default, rather than a snake-lowercased slug. A name outside [A-Za-z0-9._:+=-] needs an explicit external id or is a 400. - restore by external id works; the docs no longer steer callers to ids. - The lifecycle tests assert the preserved external id, deletedAt and a restore by external id; new tests pin the default id and the 400. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
Default external id is the file name; ids are stored verbatim and looked up case-insensitively; a charset violation is a 400 naming externalId; restore by external id takes the most recently deleted copy; and the async client's trash and restore round-trip with deleted_at. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
3 tasks done
2 tasks done
olavgg
approved these changes
Sep 30, 2026
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.
Follows datahub-platform 829a6079 (
fix(files): verbatim external ids and column-based soft delete). The SDK still assumed the old model: slug-lowercased file external ids, and a trash that rewrote the external id toDELETED_<checksum>_<id>_<epochMillis>. Against the current api,file_lifecycle_get_search_update_download_trash_restorefailed.Changes
INode.deleted_at(Rust and Python, plus the.pyistub). It is set on files listed bylist_trash.FileUpload::newdefaults the external id to the file name verbatim (sola.jpg, notsola_jpg). This matches the server's own default and the Java SDK. A file name outside[A-Za-z0-9._:+=-]now needs an explicit external id; otherwise the upload is a 400 namingexternalId.Restoring by external id works. The
restore/list_trashdocs (Rust and Python) no longer steer callers to numeric ids. By external id, the most recently deleted copy is restored.Tests:
deleted_atset, restore by external id, and checkdeleted_atis cleared afterwards.Lifecycle-Sola.JPG) and looks it up case-insensitively.default_external_id_is_the_file_nameandupload_with_an_external_id_outside_the_charset_is_a_400.Python tests (
python_tests/test_files.py):externalId.deleted_at.Breaking
INodehas a new public field, so code that builds it literally must adddeleted_at.name.extinstead ofname_ext.Docs
The Files page on datahub-sdk-docs needs updating: the default upload external id, trash entries keeping their external id plus
deletedAt, and restore by external id.Testing
cargo test(full suite): 286 passed, 34 ignored./run_python_tests.sh(full suite, before the new Python tests): 651 passed, 9 skipped./run_python_tests.sh -k test_files: 16 passed🤖 Generated with Claude Code