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

Filter list with custom function #417

Merged
merged 2 commits into from Apr 25, 2022
Merged

Filter list with custom function #417

merged 2 commits into from Apr 25, 2022

Conversation

saig0
Copy link
Member

@saig0 saig0 commented Apr 25, 2022

Description

  • a list can be filtered using a boolean function
  • currently, the function is invoked once to determine if it is a number (for index access) or a boolean value (or something else)
  • since the function is invoked without the list item, the invocation can fail if the "item" variable is passed in as a parameter
  • fix the issue by avoiding the function invocation without "item" variable in the context

Related issues

closes #359

* verify that a list can be filtered with a built-in and custom function
* verify that the custom function is invoked with the expected elements
* a list can be filtered using a boolean function
* currently, the function is invoked once to determine if it is a number (for index access) or a boolean value (or something else)
* since the function is invoked without the list item, the invocation can fail if the "item" variable is passed in as a parameter
Copy link

@pihme pihme left a comment

Choose a reason for hiding this comment

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

Looks good to me 🎉

@saig0 saig0 merged commit 11f0947 into master Apr 25, 2022
@saig0 saig0 deleted the 359-function-item-not-found branch April 25, 2022 08:25
@github-actions
Copy link

Successfully created backport PR #418 for 1.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom function invoked with ValError(no variable found for name 'item') when used in list filter condition
2 participants