Back to Vector

0.45 Upgrade Guide

website/content/en/highlights/2025-02-24-0-45-0-upgrade-guide.md

0.55.0848 B
Original Source

VRL version 0.22.0 included a couple of breaking Changes.

Thetruncate no longer supports the ellipsis argument

The ellipsis argument was deprecated. You can use suffix instead. For example:

javascript
truncate("A rather long sentence.", limit: 11, ellipsis: true)

becomes

javascript
truncate("A rather long sentence.", limit: 11, suffix: "...")

The slice VRL function preserves more type information on array elements

The slice function now preserves more type information on array elements. This might change the fallibility of functions used in your VRL programs. For example, see the following program:

text
arr = [3.5, "str"]
sub = slice!(arr, 0, 1)
first = sub[0]

# pre v0.22.0
#. = to_int!(first)

# Now,the compiler knows that `first` is an float, and we don't need the `!`.
. = to_int(first)