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

Corrected grammar in error message #28973

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

michaelrussell4
Copy link

What does this implement/fix? Explain your changes.

Corrected a grammatical error in an exception message. Previously, "is" was used when referring to the plural "elements" of a list instead of "are".

Copy link

github-actions bot commented May 7, 2024

❌ Linting issues

This PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling pre-commit hooks. Instructions to enable them can be found here.

You can see the details of the linting issues under the lint job here


black

black detected issues. Please run black . locally and push the changes. Here you can see the detected issues. Note that running black might also fix some of the issues which might be detected by ruff. Note that the installed black version is black=24.3.0.


--- /home/runner/work/scikit-learn/scikit-learn/sklearn/preprocessing/tests/test_function_transformer.py	2024-05-08 15:43:11.368351+00:00
+++ /home/runner/work/scikit-learn/scikit-learn/sklearn/preprocessing/tests/test_function_transformer.py	2024-05-08 15:43:32.113365+00:00
@@ -207,11 +207,13 @@
 
     transformer = FunctionTransformer(
         func=func, inverse_func=inverse_func, validate=False, check_inverse=True
     )
 
-    msg = "'check_inverse' is only supported when all the elements in `X` are numerical."
+    msg = (
+        "'check_inverse' is only supported when all the elements in `X` are numerical."
+    )
     with pytest.raises(ValueError, match=msg):
         transformer.fit(data)
 
 
 def test_function_transformer_support_all_nummerical_dataframes_check_inverse_True():
@@ -237,11 +239,13 @@
     transformer = FunctionTransformer(
         func=lambda x: x, inverse_func=lambda x: x, check_inverse=True
     )
 
     df_mixed = pd.DataFrame({"a": [1, 2, 3], "b": ["a", "b", "c"]})
-    msg = "'check_inverse' is only supported when all the elements in `X` are numerical."
+    msg = (
+        "'check_inverse' is only supported when all the elements in `X` are numerical."
+    )
     with pytest.raises(ValueError, match=msg):
         transformer.fit(df_mixed)
 
 
 @pytest.mark.parametrize(
would reformat /home/runner/work/scikit-learn/scikit-learn/sklearn/preprocessing/tests/test_function_transformer.py

Oh no! 💥 💔 💥
1 file would be reformatted, 922 files would be left unchanged.

ruff

ruff detected issues. Please run ruff check --fix --output-format=full . locally, fix the remaining issues, and push the changes. Here you can see the detected issues. Note that the installed ruff version is ruff=0.4.3.


sklearn/preprocessing/tests/test_function_transformer.py:212:89: E501 Line too long (89 > 88)
    |
210 |     )
211 | 
212 |     msg = "'check_inverse' is only supported when all the elements in `X` are numerical."
    |                                                                                         ^ E501
213 |     with pytest.raises(ValueError, match=msg):
214 |         transformer.fit(data)
    |

sklearn/preprocessing/tests/test_function_transformer.py:242:89: E501 Line too long (89 > 88)
    |
241 |     df_mixed = pd.DataFrame({"a": [1, 2, 3], "b": ["a", "b", "c"]})
242 |     msg = "'check_inverse' is only supported when all the elements in `X` are numerical."
    |                                                                                         ^ E501
243 |     with pytest.raises(ValueError, match=msg):
244 |         transformer.fit(df_mixed)
    |

Found 2 errors.

Generated for commit: 520dcb5. Link to the linter CI: here

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

There are linting issues according to the CI. You can follow the instructions in #28973 (comment) to fix the linting issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants