fix!: the SDK no longer prints to stdout or stderr - #167
Merged
Merged
Conversation
process_response dumped every successful response body to stdout, and the request helpers, datapoint batching and file download paths echoed errors to stderr that the returned ResponseError already carried. A library cannot be silenced by the application embedding it, so all of it goes. The body dump also sliced at a byte offset and could panic on a multi-byte character at position 2000. DataWrapperDeserialization lost its non-2xx branch: process_response only calls it for 2xx responses, so the branch and its error_body fallback never ran. BREAKING: process_response is now pub(crate) and no longer takes a path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
olavgg
approved these changes
Sep 29, 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.
What
The SDK printed from library code, and an application embedding it had no way to turn that off.
process_responsewrote every successful response body to stdout, truncated to 2000 characters. Besides the noise, this put response data into whatever captures stdout (container logs, CI output). It truncated at a byte offset, so a multi-byte UTF-8 character at position 2000 (æøå in a name or description) made the call panic after the request had already succeeded.eprintln!'d errors. Every one of those errors is also returned to the caller as aResponseError, so the output only repeated it.All of it is removed. The only prints left in
src/are in#[cfg(test)]code.DataWrapperDeserialization(both theDataWrapperandGraphDataWrapperversions) also lost its non-2xx branch.process_responseonly calls it for 2xx responses, and the 204 call sites do the same, so that branch never ran. Neither did itserror_bodyfallback. Failed responses become aResponseError, which is whatproblem()reads from.AGENTS.md no longer tells agents to keep the stdout dump. The
error_bodysentence is corrected to match.Breaking
http::process_responseis nowpub(crate)and no longer takes apathargument (pathwas used only by the print). It was request plumbing and never meant to be public API.Left alone
error_bodyonDataWrapperandGraphDataWrapperis now never filled in. TheGraphDataWrapperfield ispub, so removing it is a separate breaking change.Err(ResponseError)carrying the 2xx status. Moving it to 5xx would makeis_bufferable()re-send an ingest the server already stored, so this needs a proper decode-failure accessor rather than a different status.Docs
datahub-sdk-docs: no API signatures change for callers, apart from
process_response, which the docs shouldn't reference. If any page suggests running with--nocaptureor reading stdout to see response bodies, that advice no longer works.Tests
cargo test --all-features: 279 passed, 1 failed, 34 ignored../run_python_tests.sh: 650 passed, 9 skipped, 1 failed.Both failures are the file trash lifecycle tests (
files::test::tests::file_lifecycle_get_search_update_download_trash_restore,test_files.py::test_get_search_update_download_trash_restore). They were already failing without this change: the tests expect a trashed file's external id to start withDELETED_, and the api no longer adds that prefix. Those tests need updating separately.🤖 Generated with Claude Code