Repository: alteryx/woodwork
Pull request #1601 (2022-12-15 23:04:58)

Copy the config rather than alter

codecov[bot]: # [Codecov](https://codecov.io/gh/alteryx/woodwork/pull/1601?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx) Report
> Merging [#1601](https://codecov.io/gh/alteryx/woodwork/pull/1601?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx) (4b3eff6) into [main](https://codecov.io/gh/alteryx/woodwork/commit/9102a6b55b49be04c645f0a4ecb64dfcbcf357b4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx) (9102a6b) will **decrease** coverage by `81.19%`.
> The diff coverage is `0.00%`.

> :exclamation: Current head 4b3eff6 differs from pull request most recent head 5801e09. Consider uploading reports for the commit 5801e09 to get more accurate results

```diff
@@             Coverage Diff             @@
##             main    #1601       +/-   ##
===========================================
- Coverage   98.77%   17.57%   -81.20%     
===========================================
  Files          98       98               
  Lines       11570    11570               
===========================================
- Hits        11428     2034     -9394     
- Misses        142     9536     +9394     
```


| [Impacted Files](https://codecov.io/gh/alteryx/woodwork/pull/1601?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx) | Coverage Δ | |
|---|---|---|
| [woodwork/logical\_types.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvbG9naWNhbF90eXBlcy5weQ==) | `45.17% <0.00%> (-54.83%)` | :arrow_down: |
| [woodwork/tests/test\_config.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvdGVzdHMvdGVzdF9jb25maWcucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [woodwork/tests/test\_version.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvdGVzdHMvdGVzdF92ZXJzaW9uLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [woodwork/tests/utils/test\_utils.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvdGVzdHMvdXRpbHMvdGVzdF91dGlscy5weQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [woodwork/tests/utils/test\_concat.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvdGVzdHMvdXRpbHMvdGVzdF9jb25jYXQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [woodwork/tests/type\_system/conftest.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvdGVzdHMvdHlwZV9zeXN0ZW0vY29uZnRlc3QucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [woodwork/tests/utils/test\_read\_file.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvdGVzdHMvdXRpbHMvdGVzdF9yZWFkX2ZpbGUucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [woodwork/tests/accessor/test\_indexers.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvdGVzdHMvYWNjZXNzb3IvdGVzdF9pbmRleGVycy5weQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [woodwork/tests/demo\_tests/test\_retail.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvdGVzdHMvZGVtb190ZXN0cy90ZXN0X3JldGFpbC5weQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [woodwork/tests/fixtures/datetime\_freq.py](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx#diff-d29vZHdvcmsvdGVzdHMvZml4dHVyZXMvZGF0ZXRpbWVfZnJlcS5weQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [60 more](https://codecov.io/gh/alteryx/woodwork/pull/1601/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx) | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alteryx)


Patch:
diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst
index a70d050..e2ca7e8 100644
--- a/docs/source/release_notes.rst
+++ b/docs/source/release_notes.rst
@@ -9,6 +9,7 @@ Future Release
     * Fixes
         * Fix importlib DeprecationWarning in ``inference_functions.py`` (:pr:`1584`)
         * Schema now maintains column order after renaming a column (:pr:`1594`)
+        * Fixed logic to not set config during boolean transform (:pr:`1601`)
     * Changes
         * Rename `backup_dtype` to `pyspark_dtype` (:pr:`1593`)
         * Removed inference for `["0", "1"]`, `["0.0", "1.0"]`, and `[0, 1]` as Boolean logical types, but maintained forced inference of such values (:pr:`1600`)
diff --git a/woodwork/logical_types.py b/woodwork/logical_types.py
index f70ea63..c9c75ef 100644
--- a/woodwork/logical_types.py
+++ b/woodwork/logical_types.py
@@ -967,7 +967,7 @@ def _coerce_boolean(series, null_invalid_values=False):
 
 
 def _transform_boolean(series, null_invalid_values):
-    boolean_inference_list = config.get_option("boolean_inference_strings")
+    boolean_inference_list = config.get_option("boolean_inference_strings").copy()
     boolean_inference_list.extend([["1", "0"], ["1.0", "0.0"]])
     valid = {}
     for booleans in boolean_inference_list:


Test patch:
diff --git a/woodwork/tests/logical_types/test_logical_types.py b/woodwork/tests/logical_types/test_logical_types.py
index fbc9cf5..7f17a15 100644
--- a/woodwork/tests/logical_types/test_logical_types.py
+++ b/woodwork/tests/logical_types/test_logical_types.py
@@ -1079,6 +1079,7 @@ def test_boolean_int_works(ints_to_config, type):
 
 
 def test_boolean_strings_of_numeric_work():
+    config_len = len(config.get_option("boolean_inference_strings"))
     expected = {
         "str_ints": pd.Series([True, False, False] * 10, dtype="bool"),
         "str_floats": pd.Series([True, False, False] * 10, dtype="bool"),
@@ -1106,3 +1107,5 @@ def test_boolean_strings_of_numeric_work():
     }
     df.ww.init(logical_types=logical_types)
     pd.testing.assert_frame_equal(pd.DataFrame.from_dict(expected), df)
+    config_len_after = len(config.get_option("boolean_inference_strings"))
+    assert config_len == config_len_after