Skip to content

feat: Add to_dict and from_dict to ByteStream#9568

Merged
sjrl merged 6 commits intomainfrom
add-to-dict-bytstream
Jun 30, 2025
Merged

feat: Add to_dict and from_dict to ByteStream#9568
sjrl merged 6 commits intomainfrom
add-to-dict-bytstream

Conversation

@sjrl
Copy link
Copy Markdown
Contributor

@sjrl sjrl commented Jun 30, 2025

Related Issues

Proposed Changes:

  • Add to_dict and from_dict to ByteStream
  • Update Document.to_dict and from_dict to use the ByteStream methods
  • Serialization and deserialization of ByteStream from within Document was missing the meta field which is now included.

How did you test it?

  • Existing Document tests
  • Added unit tests

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I 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 documented my code
  • I ran pre-commit hooks and fixed any issue

@github-actions github-actions Bot added the type:documentation Improvements on the docs label Jun 30, 2025
@sjrl sjrl marked this pull request as ready for review June 30, 2025 11:34
@sjrl sjrl requested review from a team as code owners June 30, 2025 11:34
@sjrl sjrl requested review from dfokina and vblagoje and removed request for a team June 30, 2025 11:34
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Jun 30, 2025

Pull Request Test Coverage Report for Build 15972070708

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 90.282%

Totals Coverage Status
Change from base Build 15969671615: 0.005%
Covered Lines: 11715
Relevant Lines: 12976

💛 - Coveralls

Copy link
Copy Markdown
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. A small code comment that JSON doesn’t support raw binary data (self.bytes) so we need to use a list of integers as serialization format - would be helpful. But also optional as one can easily figure that out. As you wish 👍

@sjrl
Copy link
Copy Markdown
Contributor Author

sjrl commented Jun 30, 2025

Looks great. A small code comment that JSON doesn’t support raw binary data (self.bytes) so we need to use a list of integers as serialization format - would be helpful. But also optional as one can easily figure that out. As you wish 👍

Thanks! I added a code comment.

@sjrl sjrl enabled auto-merge (squash) June 30, 2025 11:49
@sjrl sjrl merged commit 97e72b9 into main Jun 30, 2025
19 checks passed
@sjrl sjrl deleted the add-to-dict-bytstream branch June 30, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:tests type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add to_dict/from_dict to ByteStream

3 participants