Skip to content

Don't output traits if they are empty. #383

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

Closed
wants to merge 2 commits into from
Closed

Don't output traits if they are empty. #383

wants to merge 2 commits into from

Conversation

bsneed
Copy link
Contributor

@bsneed bsneed commented Mar 11, 2025

  • Added OmitIfNull property wrapper to avoid outputting keys with values that are null.
  • Modified context traits to only output if non-null.
  • Added test.

Copy link

codecov bot commented Mar 11, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 71.07%. Comparing base (59ae167) to head (62dd673).

Files with missing lines Patch % Lines
Sources/Segment/Utilities/OmitIfNull.swift 50.00% 8 Missing ⚠️

❌ Your patch status has failed because the patch coverage (50.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
- Coverage   71.12%   71.07%   -0.05%     
==========================================
  Files          48       49       +1     
  Lines        4894     4910      +16     
==========================================
+ Hits         3481     3490       +9     
- Misses       1413     1420       +7     
Files with missing lines Coverage Δ
Sources/Segment/Types.swift 44.05% <ø> (ø)
Sources/Segment/Utilities/OmitIfNull.swift 50.00% <50.00%> (ø)

... and 1 file with indirect coverage changes

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

@bsneed
Copy link
Contributor Author

bsneed commented Mar 12, 2025

Closing this PR as it's unnecessary. Empty traits are being added server-side, not the library.

@bsneed bsneed closed this Mar 12, 2025
@bsneed bsneed deleted the bsneed/traits branch March 19, 2025 18:11
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