-
Notifications
You must be signed in to change notification settings - Fork 37
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
Ensure UTF-8 encoding for reading non-english characters #1211
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Partho Sarthi <[email protected]>
parthosa
added
bug
Something isn't working
user_tools
Scope the wrapper module running CSP, QualX, and reports (python)
labels
Jul 22, 2024
Signed-off-by: Partho Sarthi <[email protected]>
amahussein
reviewed
Jul 22, 2024
core/src/test/scala/com/nvidia/spark/rapids/tool/util/ToolUtilsSuite.scala
Outdated
Show resolved
Hide resolved
parthosa
added
core_tools
Scope the core module (scala)
and removed
user_tools
Scope the wrapper module running CSP, QualX, and reports (python)
labels
Jul 22, 2024
amahussein
requested changes
Jul 22, 2024
core/src/test/scala/com/nvidia/spark/rapids/tool/util/ToolUtilsSuite.scala
Outdated
Show resolved
Hide resolved
Signed-off-by: Partho Sarthi <[email protected]>
amahussein
approved these changes
Jul 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @parthosa
LGTME
parthosa
changed the title
Ensure UTF-8 encoding for reading non-english characters in unit tests
Ensure UTF-8 encoding for reading non-english characters
Jul 23, 2024
cindyyuanjiang
approved these changes
Jul 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @parthosa!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1209. This PR fixes an issue where unit tests fail due to encoding errors when reading non-English characters.
Changes
UTF8Source
aroundSource
with charset set asUTF8
scalastyle_config.xml
that disables usage of anySource.from
related methods.FSUtils.readFileContentAsUTF8()
to read file as UTF8 and close resources.Scalastyle Output
Verified the scalastyle check in
dev
branch. 28 occurrences ofSource.from
are detected.Scalastyle Output
Testing
Tested the changes in a CICD job.
Note
Source.from
instead of specifics (i.e.Source.fromFile
) so that in future if anyone uses a new method (eg.Source.fromURI
), it will be automatically be caught.