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

fix(diagnostics): add 'set_semantic_meaning' to the side effects list #1148

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

pront
Copy link
Member

@pront pront commented Nov 27, 2024

Summary

This modifies internal state and it's return value is always returns null. Should not expect result usage.

This is true for all functions returning null so we could follow up with an enhancement to the unused expression detector.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

Pointed Vector to this VRL branch and tested with:

sources:
  demo_logs:
    type: demo_logs
    format: json
transforms:
  remap:
    type: remap
    inputs: [demo_logs]
    source: |
      set_semantic_meaning(.foo, "a")
      .foo = "bar"
sinks:
  console:
    type: console
    inputs: [remap]
    encoding:
      codec: json

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on
    our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

Checklist

  • Our CONTRIBUTING.md is a good starting place.
  • If this PR introduces changes to LICENSE-3rdparty.csv, please
    run dd-rust-license-tool write and commit the changes. More details here.
  • For new VRL functions, please also create a sibling PR in Vector to document the new function.

References

@pront pront enabled auto-merge November 27, 2024 19:24
@pront pront requested a review from bfung November 27, 2024 19:24
@pront pront added this pull request to the merge queue Nov 27, 2024
Merged via the queue into main with commit d14bcb8 Nov 27, 2024
15 checks passed
@pront pront deleted the pront/sem-meaning-side-effects branch November 27, 2024 19:40
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.

VRL compiler warns about the unused result of set_semantic_meaning
2 participants