Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR bumps the version to 1.2.3 while enhancing error messaging in metadata concatenation and adding tests to verify header metadata serialization for various data types.
- Update version in pyproject.toml
- Improve multi-line error messages in metadata concatenation functions
- Add tests for validating header metadata serialization across data types
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_adat_writing.py | Adds tests to verify serialization of header metadata values of different types. |
| somadata/tools/adat_concatenation.py | Updates error message formatting for improved clarity in metadata concatenation. |
| somadata/io/adat/file.py | Adjusts ReportConfig handling and changes output method for header metadata. |
| pyproject.toml | Bumps library version from 1.2.2 to 1.2.3. |
Comments suppressed due to low confidence (1)
somadata/io/adat/file.py:282
- The use of json.dumps without sort_keys may result in nondeterministic key ordering for ReportConfig, which can lead to inconsistent serialized output. Adding sort_keys=True would ensure a stable and predictable ordering.
f.write(row[0] + '\t' + json.dumps(row[1], separators=(',', ':')) + '\r\n')
| self.assertEqual(header_metadata['HeaderNone'], '') | ||
| self.assertEqual(header_metadata['HeaderList'], '[1, 2, 3]') | ||
| self.assertEqual( | ||
| header_metadata['HeaderDict'], |
There was a problem hiding this comment.
Comparing the string representation of a dict (HeaderDict) may lead to flaky tests due to nondeterministic key ordering. Consider serializing the dict using json.dumps with sort_keys=True and comparing against that output or compare dictionaries directly.
alexatSL
approved these changes
Jun 10, 2025
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.
Bump version to 1.2.3, enhance error messaging in metadata concatenation, and add tests for various header data types