Skip to content

CAN-25#15

Merged
kyoung73 merged 1 commit intomainfrom
CAN-25
Jun 11, 2025
Merged

CAN-25#15
kyoung73 merged 1 commit intomainfrom
CAN-25

Conversation

@kyoung73
Copy link
Copy Markdown
Contributor

@kyoung73 kyoung73 commented Jun 5, 2025

Bump version to 1.2.3, enhance error messaging in metadata concatenation, and add tests for various header data types

Bump version to 1.2.3, enhance error messaging in metadata concatenation, and add tests for various header data types
@kyoung73 kyoung73 self-assigned this Jun 5, 2025
@kyoung73 kyoung73 requested review from alexatSL and Copilot June 5, 2025 19:21
@kyoung73 kyoung73 added the bug Something isn't working label Jun 5, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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'],
Copy link

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@kyoung73 kyoung73 merged commit 34610d2 into main Jun 11, 2025
5 checks passed
@kyoung73 kyoung73 deleted the CAN-25 branch June 11, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants