Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pdata] Deprecate New[Slice|Map]FromRaw functions #6045

Merged
merged 1 commit into from
Sep 12, 2022

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Sep 9, 2022

Use New[Slice|Map]().FromRaw() instead fo consistency with the interface provided by primitive slices.

Link to tracking Issue: #6041

@dmitryax dmitryax requested review from a team and Aneurysm9 September 9, 2022 23:03
@dmitryax dmitryax force-pushed the chang-map-slice-raw branch 4 times, most recently from df81f04 to 440f7cd Compare September 9, 2022 23:14
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Base: 91.95% // Head: 91.89% // Decreases project coverage by -0.06% ⚠️

Coverage data is based on head (cc25e1a) compared to base (8b26740).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6045      +/-   ##
==========================================
- Coverage   91.95%   91.89%   -0.07%     
==========================================
  Files         216      216              
  Lines       13390    13411      +21     
==========================================
+ Hits        12313    12324      +11     
- Misses        858      868      +10     
  Partials      219      219              
Impacted Files Coverage Δ
pdata/pcommon/common.go 95.00% <100.00%> (-1.60%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dmitryax dmitryax changed the title Deprecate New[Slice|Map]FromRaw functions [pdata] Deprecate New[Slice|Map]FromRaw functions Sep 9, 2022
@dmitryax
Copy link
Member Author

dmitryax commented Sep 9, 2022

@bogdandrutu NewMapFromRaw is used pretty extensively for tests in contrib to create map instances inline. This PR introduces significant inconvenience. I'm wondering if we should have some additional helper, or eventually make FromRaw returning the map itself... I'll submit a draft PR in contrib

@dmitryax
Copy link
Member Author

Maybe returning map by FromRaw is ok given that we already return map by Sort

pdata/pcommon/common_test.go Outdated Show resolved Hide resolved
codeboten pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2022
Use New[Slice|Map]().FromRaw() instead fo consistency with the interface provided by primitive slices.
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.

2 participants