Skip to content

docs: detailing in docstrings the scope and context of each serialisation function - #11899

Closed
davidsbatista wants to merge 1 commit into
mainfrom
docs/clarify-serialization-envelope-boundaries
Closed

docs: detailing in docstrings the scope and context of each serialisation function#11899
davidsbatista wants to merge 1 commit into
mainfrom
docs/clarify-serialization-envelope-boundaries

Conversation

@davidsbatista

Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

Docstring-only additions, no behavior change. Added short "why" notes to 5 functions that looked like they could be merged or simplified, but can't:

  • default_to_dict/default_from_dict (core/serialization.py) — notes this is the on-disk pipeline YAML format, incompatible with base_serialization's.
  • _serialize_value_with_schema (utils/base_serialization.py) — notes it's for runtime values, not Components, and points back to the note above.
  • _serializable_value (tracing/utils.py) — notes it's deliberately one-way/lossy, unlike the schema serializer.
  • _serialize_content_part (dataclasses/chat_message.py) — notes the short tags are a deliberate hand-writable public format.
  • _serialize_object (components/generators/utils.py) — notes it skips private attributes for OpenAI SDK objects, unlike the generic serializer.

These came out of an investigation into duplicated/scattered serialization code (see related PRs). Most of what looked like duplication turned out to be intentional separation — these notes capture the reasoning directly in the code so it doesn't get
"helpfully" merged later.

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@davidsbatista
davidsbatista requested a review from a team as a code owner July 7, 2026 14:13
@davidsbatista
davidsbatista requested review from sjrl and removed request for a team July 7, 2026 14:13
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
haystack-docs Ignored Ignored Jul 7, 2026 2:13pm

Request Review

@github-actions github-actions Bot added topic:core type:documentation Improvements on the docs labels Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/components/generators
  utils.py
Project Total  

This report was generated by python-coverage-comment-action

@davidsbatista davidsbatista added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release-notes PRs with this flag won't be included in the release notes. topic:core type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant