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

[17.0][FIX] Allow matching of partner in not at the begining of the string #774

Closed
wants to merge 3 commits into from

Conversation

davidwul
Copy link

re.match will yield a partner only if the search string is at the begining of the string. The match partner functionality does not specify the string needs to be at the begining. Therefore search would be more suitable.

@pedrobaeza pedrobaeza added this to the 17.0 milestone Dec 30, 2024
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

You are introducing a regex in the field, so for matching something in the middle, you have to put .*<text>, so it's correct as it is.

@pedrobaeza
Copy link
Member

You mustn't change this. Simply define correctly the regex on your model putting that .* if you want to match a word in the middle. Closing this PR.

@pedrobaeza pedrobaeza closed this Dec 30, 2024
@davidwul
Copy link
Author

I don't agree with you,
when regexp is expected, it's mentionned:
image
but for partner mapping, nothing is mentionned:
image
we should change this for usability purpose. My proposal is to change here

@pedrobaeza
Copy link
Member

@etobella what do you think?

@etobella
Copy link
Member

I do not agree with the suggestion you introduced @davidwul you can add it there directly on the regex field 🤔

@davidwul
Copy link
Author

@etobella
I fully understand the developper's position. It's perfectly usable like that. But from a non developper point of view, there is no indication a regexp is needed. The labels or hints does suggest it's a search. Either adding more info for the user or changing re.match to re.search would be welcome from the lambda user perspective.

@etobella
Copy link
Member

@davidwul I understand your concerns, but in this case I would recommend to change the label of the field. First reason is that if someone used ^whatevertext I want, your change will break the configuration. Also, removing the ^ is not a good idea, because I might want to force it to be at the start.

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.

3 participants