Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengruifeng committed May 21, 2024
1 parent c9c0d10 commit 2e73a74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/pyspark/sql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from pyspark.sql.utils import (
has_numpy,
get_active_spark_context,
escapeMetaCharacters,
escape_meta_characters,
StringConcat,
)
from pyspark.sql.variant_utils import VariantUtils
Expand Down Expand Up @@ -1076,7 +1076,7 @@ def _build_formatted_string(
) -> None:
if maxDepth > 0:
stringConcat.append(
f"{prefix}-- {escapeMetaCharacters(self.name)}: {self.dataType.typeName()} "
f"{prefix}-- {escape_meta_characters(self.name)}: {self.dataType.typeName()} "
+ f"(nullable = {str(self.nullable).lower()})\n"
)
DataType._data_type_build_formatted_string(
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/sql/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def toString(self) -> str:


# Python implementation of 'org.apache.spark.util.SparkSchemaUtils.escapeMetaCharacters'
def escapeMetaCharacters(s: str) -> str:
def escape_meta_characters(s: str) -> str:
return (
s.replace("\n", "\\n")
.replace("\r", "\\r")
Expand Down

0 comments on commit 2e73a74

Please sign in to comment.