Skip to content

Conversation

VihasMakwana
Copy link
Contributor

Description

This PR enhances FromRaw method to support:

  1. slices of supported types
    • For eg. if we pass a slice of []string, it will fail. But we support the string type
  2. custom types that are maps
    • This is a special case when the user has defined a custom type, with map[string]any as the underlying type.
    • We use reflection to convert the type to map[string]any
  3. We can optionally support time.Time by converting it to a ISO 8601 format string.

I'm happy to hear @bogdandrutu and @dmitryax's thoughts on this enhancement.

Testing

Will add testing if we decide to go forward with this change.

Copy link

codecov bot commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 25.00000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.38%. Comparing base (75f20d4) to head (aa35490).
⚠️ Report is 39 commits behind head on main.

Files with missing lines Patch % Lines
pdata/pcommon/value.go 25.00% 15 Missing ⚠️

❌ Your patch check has failed because the patch coverage (25.00%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13810      +/-   ##
==========================================
- Coverage   91.42%   91.38%   -0.05%     
==========================================
  Files         640      640              
  Lines       42599    42687      +88     
==========================================
+ Hits        38946    39008      +62     
- Misses       2834     2857      +23     
- Partials      819      822       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant