fix: Fix decimal separator to "." (dot) on Oracle #1042
Merged
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.
Setting
NLS_NUMERIC_CHARACTERS
to'.,'
when connecting to Oracle to ensure we get.
as the decimal separator when converting decimals to string. This matches PostgreSQL and BigQuery.I've been trying to manually test if the same applies on Teradata but cannot figure out how to setup a failure in order to fix it. I suspect we'll have similar issues on other engines in the future but this PR is restricted to Oracle.
I've also been unable to write a test for this. I added a test to
test_oracle.py
that failed without my fix and passed with it but, unfortunately, when I run all tests the new test passed even without the fix. I think this is becauseos.environ
is captured when cx-Oracle is imported, when my test ran alone then my manipulation ofos.environ
worked. When my test ran amongst other tests my setup was not effective.I've captured the test below for posterity but am submitting this PR based on manual testing alone.