You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2023/04/24 04:03:02 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #40916: [SPARK-43243][PYTHON][CONNECT] Add level param to printSchema for Python

HyukjinKwon commented on code in PR #40916:
URL: https://github.com/apache/spark/pull/40916#discussion_r1174756518


##########
python/pyspark/sql/dataframe.py:
##########
@@ -575,14 +575,23 @@ def schema(self) -> StructType:
                 )
         return self._schema
 
-    def printSchema(self) -> None:
+    def printSchema(self, level: Optional[int] = None) -> None:
         """Prints out the schema in the tree format.
+        Optionally allows to specify how many levels to print if schema is nested.
 
         .. versionadded:: 1.3.0
 
         .. versionchanged:: 3.4.0
             Supports Spark Connect.
 
+        .. versionchanged:: 3.5.0
+            Added Level parameter.
+
+        Parameters
+        ----------
+        level : int, optional, default None
+            How many levels to print for nested schemas.

Review Comment:
   Can we move:
   
   ```
           .. versionchanged:: 3.5.0
               Added Level parameter.
   ```
   
   to here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org