This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 8797f6f6b55d [MINOR] Fix an invalid escape string
8797f6f6b55d is described below
commit 8797f6f6b55d19d4e84521c05c5e309a618f32c1
Author: Tian Gao <[email protected]>
AuthorDate: Tue Jan 6 07:42:06 2026 +0900
[MINOR] Fix an invalid escape string
### What changes were proposed in this pull request?
`"\_"` is replaced with `"\\_"`. The `W605` comment is no longer necessary.
### Why are the changes needed?
`"\_"` is not a valid python string literal because it's trying to escape
`"_"`. The correct way to express the literal `\_` is either `"\\_"` or
`r"\_"`. The original linter warning is valid, code is incorrect.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Linter passed
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #53672 from gaogaotiantian/fix-wrong-escape.
Authored-by: Tian Gao <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
---
python/pyspark/pandas/supported_api_gen.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/pyspark/pandas/supported_api_gen.py
b/python/pyspark/pandas/supported_api_gen.py
index 3f7efa7784ab..ddb890e04327 100644
--- a/python/pyspark/pandas/supported_api_gen.py
+++ b/python/pyspark/pandas/supported_api_gen.py
@@ -397,7 +397,7 @@ def _escape_func_str(func_str: str) -> str:
# TODO: Take into account that this function can create links incorrectly
# We can create alias links or links to parent methods
if func_str.endswith("_"):
- return func_str[:-1] + "\_" # noqa: W605
+ return func_str[:-1] + "\\_"
else:
return func_str
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]