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: skip last header line in csv #6568

Merged
merged 1 commit into from
Apr 8, 2022
Merged

Conversation

dipietroR
Copy link
Contributor

Seeing:

Argument "Transformation" isn't numeric in addition (+) at /opt/product-opener/lib/ProductOpener/Ecoscore.pm line 139, <$io> line 8.
Argument "Emballage" isn't numeric in addition (+) at /opt/product-opener/lib/ProductOpener/Ecoscore.pm line 139, <$io> line 8.
Argument "Transport" isn't numeric in addition (+) at /opt/product-opener/lib/ProductOpener/Ecoscore.pm line 139, <$io> line 8.
Argument "Supermarch\x{e9} et distribution" isn't numeric in addition (+) at /opt/product-opener/lib/ProductOpener/Ecoscore.pm line 139, <$io> line 8.

Errors. This may be from adding 0 to an undefined value rather than using a default.

There was no ecoscore popping up on the products on the local dev environment. I see them on the app. Though I'm not sure how to test there. Or quite what to test on the dev environment, as I don't see the ecoscore there to check that it is still there after this change. This does seem to clear the errors on startup.

@dipietroR dipietroR requested a review from a team as a code owner April 7, 2022 00:11
@dipietroR dipietroR changed the title Fix: using default assignment rather than addition of zero fix: using default assignment rather than addition of zero Apr 7, 2022
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

This PR is a good idea, but I think you should ensure we have ints.

lib/ProductOpener/Ecoscore.pm Outdated Show resolved Hide resolved
@dipietroR dipietroR changed the title fix: using default assignment rather than addition of zero fix: skip last header line in csv Apr 8, 2022
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 8, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Cool

@alexgarel alexgarel merged commit 915716d into openfoodfacts:main Apr 8, 2022
@dipietroR dipietroR deleted the numeric branch May 1, 2022 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants