class_docstr: These test cases exercise the interface to the proto plan
  generation but do not call Spark.
code: def compare_by_show(self, df1, df2, n: int = 20, truncate: int = 20):
      assert isinstance(df1, (SDF, CDF))
      if isinstance(df1, SDF):
          str1 = df1._jdf.showString(n, truncate, False)
      else:
          str1 = df1._show_string(n, truncate, False)
  
      assert isinstance(df2, (SDF, CDF))
      if isinstance(df2, SDF):
          str2 = df2._jdf.showString(n, truncate, False)
      else:
          str2 = df2._show_string(n, truncate, False)
  
      self.assertEqual(str1, str2)
  
file_path: spark/python/pyspark/ml/tests/connect/test_connect_function.py
imports: import os
  import unittest
  from pyspark.sql import SparkSession
  from pyspark.sql.dataframe import DataFrame
  from pyspark.ml import functions
  from pyspark.testing.sqlutils import SQLTestUtils
  from pyspark.testing.connectutils import should_test_connect, ReusedConnectTestCase
  from pyspark.testing.pandasutils import PandasOnSparkTestUtils
label_desc: Use image node_id 3 for calling the SparkConnectMLFunctionTests obj's underlying member method code with example usage: obj.compare_by_show(df1, df2, n, truncate) without return types