code: def test_from_records_with_datetimes(self):
      # this may fail on certain platforms because of a numpy issue
      # related GH#6140
      if not is_platform_little_endian():
          pytest.skip("known failure of test on non-little endian")
  
      # construction with a null in a recarray
      # GH#6140
      expected = DataFrame(
          {"EXPIRY": [datetime(2005, 3, 1, 0, 0), None]}
      )
  
      arrdata = [np.array([datetime(2005, 3, 1, 0, 0), None])]
      dtypes = [("EXPIRY", "<M8[ns]")]
  
      recarray = np.rec.fromarrays(arrdata, dtype=dtypes)
  
      result = DataFrame.from_records(recarray)
      tm.assert_frame_equal(result, expected)
  
      # coercion should work too
      arrdata = [np.array([datetime(2005, 3, 1, 0, 0), None])]
      dtypes = [("EXPIRY", "<M8[m]")]
      recarray = np.rec.fromarrays(arrdata, dtype=dtypes)
      result = DataFrame.from_records(recarray)
      # we get the closest supported unit, "s"
      expected["EXPIRY"] = expected["EXPIRY"].astype("M8[s]")
      tm.assert_frame_equal(result, expected)
  
imports: from collections.abc import Iterator
  from datetime import datetime
  from decimal import Decimal
  import numpy
  import pytest
  import pytz
  from pandas._config import using_pyarrow_string_dtype
  from pandas.compat import is_platform_little_endian
  from pandas import CategoricalIndex, DataFrame, Index, Interval, RangeIndex, Series, date_range
  import pandas._testing
label_desc: Use image node_id 2 for calling the TestFromRecords obj's underlying member method code with example usage: obj.test_from_records_with_datetimes() without return types