Skip to content

fix!: the SDK no longer prints to stdout or stderr - #167

Merged
olavgg merged 1 commit into
mainfrom
fix/sdk-no-print
Sep 29, 2026
Merged

olavgg merged 1 commit into
mainfrom
fix/sdk-no-print

Conversation

@JosteinGj

Copy link
Copy Markdown
Contributor

What

The SDK printed from library code, and an application embedding it had no way to turn that off.

  • process_response wrote 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.
  • The request helpers, datapoint batching, and file download/upload paths eprintln!'d errors. Every one of those errors is also returned to the caller as a ResponseError, so the output only repeated it.
  • The datapoint insert printed batch-progress lines on every ingest large enough to need batching.

All of it is removed. The only prints left in src/ are in #[cfg(test)] code.

DataWrapperDeserialization (both the DataWrapper and GraphDataWrapper versions) also lost its non-2xx branch. process_response only calls it for 2xx responses, and the 204 call sites do the same, so that branch never ran. Neither did its error_body fallback. Failed responses become a ResponseError, which is what problem() reads from.

AGENTS.md no longer tells agents to keep the stdout dump. The error_body sentence is corrected to match.

Breaking

  • http::process_response is now pub(crate) and no longer takes a path argument (path was used only by the print). It was request plumbing and never meant to be public API.
  • Callers who relied on seeing response bodies on stdout while debugging will no longer see them.

Left alone

  • error_body on DataWrapper and GraphDataWrapper is now never filled in. The GraphDataWrapper field is pub, so removing it is a separate breaking change.
  • A 2xx response whose body won't parse still comes back as Err(ResponseError) carrying the 2xx status. Moving it to 5xx would make is_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 --nocapture or 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 with DELETED_, and the api no longer adds that prefix. Those tests need updating separately.

🤖 Generated with Claude Code

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>
@JosteinGj
JosteinGj requested a review from olavgg September 29, 2026 12:38
@olavgg
olavgg merged commit 4181a4c into main Sep 29, 2026
18 checks passed
@olavgg
olavgg deleted the fix/sdk-no-print branch September 29, 2026 12:40
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.

2 participants