Skip to content

Conversation

@Knerio
Copy link
Member

@Knerio Knerio commented Nov 26, 2025

close #158

Copy link

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 pull request fixes the to_h serialization method for DataTypeIdentifier to ensure it only returns the populated field (one of: data_type_identifier, generic_type, or generic_key) rather than all fields with nil values. Additionally, it updates related serialization/deserialization methods in GenericType and GenericMapper classes to handle renamed fields (generic_mappergeneric_mappers).

  • Modified DataTypeIdentifier#to_h to return only the populated field using conditional logic
  • Updated GenericType#to_h and #from_hash to use generic_mappers (plural) instead of generic_mapper (singular)
  • Refactored GenericMapper#to_h and #from_hash to use new field names (target, source, generic_combinations)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.

File Description
build/ruby/lib/tucana/shared/shared.data_type.rb Implemented conditional serialization in DataTypeIdentifier#to_h and updated field names in GenericType and GenericMapper classes
build/ruby/spec/tucana/shared/shared.data_type_spec.rb Added test coverage for DataTypeIdentifier#to_h method with three variants (generic_key, identifier, generic_type)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Dario Pranjic <96529060+Knerio@users.noreply.github.com>
@Knerio Knerio force-pushed the 158-datatypeidentifierto_h-returns-nil-values-even-tough-they-should-be-there branch from 4b78140 to 96ceedd Compare November 26, 2025 21:02
@Knerio Knerio requested a review from Copilot November 26, 2025 21:02
Copy link

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Taucher2003 Taucher2003 merged commit a997e32 into main Nov 26, 2025
9 checks passed
@Taucher2003 Taucher2003 deleted the 158-datatypeidentifierto_h-returns-nil-values-even-tough-they-should-be-there branch November 26, 2025 21:25
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.

DataTypeIdentifier.to_h returns nil values even tough they should be there

3 participants