code: def test_construct_dask_float_array_int_dtype_match_ndarray():
      # GH#40110 make sure we treat a float-dtype dask array with the same
      #  rules we would for an ndarray
      dd = pytest.importorskip("dask.dataframe")
  
      arr = np.array([1, 2.5, 3])
      darr = dd.from_array(arr)
  
      res = Series(darr)
      expected = Series(arr)
      tm.assert_series_equal(res, expected)
  
      # GH#49599 in 2.0 we raise instead of silently ignoring the dtype
      msg = "Trying to coerce float values to integers"
      with pytest.raises(ValueError, match=msg):
          Series(darr, dtype="i8")
  
      msg = r"Cannot convert non-finite values \(NA or inf\) to integer"
      arr[2] = np.nan
      with pytest.raises(IntCastingNaNError, match=msg):
          Series(darr, dtype="i8")
      # which is the same as we get with a numpy input
      with pytest.raises(IntCastingNaNError, match=msg):
          Series(arr, dtype="i8")
  
imports: import array
  from functools import partial
  import subprocess
  import sys
  import numpy
  import pytest
  from pandas.errors import IntCastingNaNError
  import pandas
  from pandas import DataFrame, DatetimeIndex, Series, TimedeltaIndex
  import pandas._testing
  from pandas.core.arrays import DatetimeArray, TimedeltaArray
label_desc: Use image node_id 4 for calling a global function with example usage: test_construct_dask_float_array_int_dtype_match_ndarray() without return types