code: def test_date_subtraction(self):
      pdf = self.pdf1
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(
          psdf["end_date"].dt.date - psdf["start_date"].dt.date,
          (pdf["end_date"].dt.date - pdf["start_date"].dt.date).apply(
              lambda x: x.days
          ),
      )
  
      self.assert_eq(
          psdf["end_date"].dt.date - datetime.date(2012, 1, 1),
          (pdf["end_date"].dt.date - datetime.date(2012, 1, 1)).apply(
              lambda x: x.days
          ),
      )
  
      self.assert_eq(
          datetime.date(2013, 3, 11) - psdf["start_date"].dt.date,
          (
              datetime.date(2013, 3, 11) - pdf["start_date"].dt.date
          ).apply(lambda x: x.days),
      )
  
      psdf = ps.DataFrame(
          {
              "a": pd.date_range("2016-12-31", "2017-01-08", freq="D"),
              "b": pd.Series(range(9)),
          }
      )
      expected_error_message = (
          "Date subtraction can only be applied to date series."
      )
      with self.assertRaisesRegex(TypeError, expected_error_message):
          psdf["a"].dt.date - psdf["b"]
      with self.assertRaisesRegex(TypeError, expected_error_message):
          psdf["a"].dt.date - 1
      with self.assertRaisesRegex(TypeError, expected_error_message):
          1 - psdf["a"].dt.date
  
imports: import datetime
  import unittest
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.testing.pandasutils import PandasOnSparkTestCase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 8 for calling the SeriesDateTimeTestsMixin obj's underlying member method code with example usage: obj.test_date_subtraction() without return types