Skip to content

Conversation

@florenp
Copy link
Contributor

@florenp florenp commented Mar 18, 2025

element function support negative index starting in version 1.10.0, but documentation still says that it doesn't support it.

Target Release

1.12.x

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@florenp florenp requested review from a team as code owners March 18, 2025 10:04
@hashicorp-cla-app
Copy link

hashicorp-cla-app bot commented Mar 18, 2025

CLA assistant check
All committers have signed the CLA.

@crw crw added documentation no-changelog-needed Add this to your PR if the change does not require a changelog entry labels Mar 18, 2025
@crw
Copy link
Contributor

crw commented Mar 19, 2025

This is the change that enabled this functionality: #35501

```
> element(["a", "b", "c"], length(["a", "b", "c"])-1)
> element(["a", "b", "c"], -1)
c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run this, the output I get is:
"c"

This is true for the other examples as well. Is this system-dependent? (I am on MacOS.) If not, we should update the output to be correct as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, "c" is always correct, because it is a quoted string value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crw Ok for you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @florenp, per @jbardin's comment, all of the output values should be quoted. That would be ideal. If you just want to make the change to quote your new output value, I will open a new PR to clean up the rest of the page. Or, you could update all of the examples. Either way. Thanks!

Copy link
Contributor Author

@florenp florenp Mar 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @crw
That's done.

@crw crw added 1.10-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged 1.11-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged waiting-response An issue/pull request is waiting for a response from the community labels Mar 19, 2025
@crw crw merged commit 796f27a into hashicorp:main Mar 21, 2025
8 of 9 checks passed
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

1.10-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged 1.11-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged documentation no-changelog-needed Add this to your PR if the change does not require a changelog entry waiting-response An issue/pull request is waiting for a response from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants