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: regex in numeric Values in meta-data #3740

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gast04
Copy link

@gast04 gast04 commented Dec 11, 2024

I do not know all the details, but the regex seems wrong, as numeric values are prefixed with \ [backslash and space] (as stated in another discussion, https://stackoverflow.com/questions/2154945/how-to-force-a-meta-data-value-to-type-string , and in the file itself).

This won't match with the current regex, meaning all values are non numeric.
For example if I add a log:

MetadataValue NOT numeric: '\ 34173474129'

which is a numeric value.

In my case this leads to an issue, changing the regex and replace the unnecessary trim with a substring(2). fixes it in my case.

Not sure about any side effect, need to do a bit more testing. Just wanted to drop it here, in case anyone else has issues with numeric metadata values.

@iBotPeaches
Copy link
Owner

Okay, I fear we will need some unit-tests for this. We keep changing this and I now assume I don't even know the right answer.

@gast04
Copy link
Author

gast04 commented Dec 11, 2024

totally agree, I will try adding unit-tests for that tomorrow, and fixing the ones that are currently failing.

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.

2 participants