Skip to content

Commit

Permalink
[pdata] Update return value of pcommon.ValueType.String for ValueTypeStr
Browse files Browse the repository at this point in the history
Recently we updated all names related to pdata String value. It makes sense to update string returned by Value.String accordingly to avoid discrepancy with other value types
  • Loading branch information
dmitryax committed Oct 6, 2022
1 parent e0eea95 commit 904f844
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Delete deprecated `StringVal` and `SetStringVal` methods. (#6178)
- Delete deprecated `ValueTypeString` method. (#6178)
- Change AggregationTemporality.String to simpler, easier to read. (#6117)
- Update pcommon.ValueType.String to return "STR" for ValueTypeStr. (#6127)

### 🚩 Deprecations 🚩

Expand Down
2 changes: 1 addition & 1 deletion pdata/pcommon/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (avt ValueType) String() string {
case ValueTypeEmpty:
return "EMPTY"
case ValueTypeStr:
return "STRING"
return "STR"
case ValueTypeBool:
return "BOOL"
case ValueTypeInt:
Expand Down
2 changes: 1 addition & 1 deletion pdata/pcommon/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestValue(t *testing.T) {

func TestValueType(t *testing.T) {
assert.EqualValues(t, "EMPTY", ValueTypeEmpty.String())
assert.EqualValues(t, "STRING", ValueTypeStr.String())
assert.EqualValues(t, "STR", ValueTypeStr.String())
assert.EqualValues(t, "BOOL", ValueTypeBool.String())
assert.EqualValues(t, "INT", ValueTypeInt.String())
assert.EqualValues(t, "DOUBLE", ValueTypeDouble.String())
Expand Down

0 comments on commit 904f844

Please sign in to comment.