parameters: (dtype)
return_statement: return _np_pa_dtypes[cudf.dtype(dtype).type]
docstring: Util to convert numpy dtype to PyArrow dtype.
docstring_summary: Util to convert numpy dtype to PyArrow dtype.
docstring_tokens: Util to convert numpy dtype to PyArrow dtype .
function: def np_to_pa_dtype(dtype):
      """Util to convert numpy dtype to PyArrow dtype."""
      # special case when dtype is np.datetime64
      if dtype.kind == "M":
          time_unit, _ = np.datetime_data(dtype)
          if time_unit in ("s", "ms", "us", "ns"):
              # return a pa.Timestamp of the appropriate unit
              return pa.timestamp(time_unit)
          # default is int64_t UNIX ms
          return pa.date64()
      elif dtype.kind == "m":
          time_unit, _ = np.datetime_data(dtype)
          if time_unit in ("s", "ms", "us", "ns"):
              # return a pa.Duration of the appropriate unit
              return pa.duration(time_unit)
          # default fallback unit is ns
          return pa.duration("ns")
      return _np_pa_dtypes[cudf.dtype(dtype).type]
function_tokens: def np_to_pa_dtype ( dtype ) : # special case when dtype is np.datetime64 if dtype . kind == "M" : time_unit , _ = np . datetime_data ( dtype ) if time_unit in ( "s" , "ms" , "us" , "ns" ) : # return a pa.Timestamp of the appropriate unit return pa . timestamp ( time_unit ) # default is int64_t UNIX ms return pa . date64 ( ) elif dtype . kind == "m" : time_unit , _ = np . datetime_data ( dtype ) if time_unit in ( "s" , "ms" , "us" , "ns" ) : # return a pa.Duration of the appropriate unit return pa . duration ( time_unit ) # default fallback unit is ns return pa . duration ( "ns" ) return _np_pa_dtypes [ cudf . dtype ( dtype ) . type ]