diff --git a/header-only/awkward/utils.h b/header-only/awkward/utils.h index e81d7a06db..1506594487 100644 --- a/header-only/awkward/utils.h +++ b/header-only/awkward/utils.h @@ -62,6 +62,14 @@ namespace awkward { return "int64"; } + /// @brief Returns `int64` string when the primitive type + /// is a 64-bit signed integer. + template <> + const std::string + type_to_name() { + return "int64"; + } + /// @brief Returns `uint8` string when the primitive type /// is an 8-bit unsigned integer. template <> diff --git a/tests/test_2023-from-rdataframe.py b/tests/test_2023-from-rdataframe.py new file mode 100644 index 0000000000..8802a7787a --- /dev/null +++ b/tests/test_2023-from-rdataframe.py @@ -0,0 +1,24 @@ +# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE + +import numpy as np # noqa: F401 +import pytest + +import awkward as ak +import awkward._connect.cling +import awkward._lookup + +ROOT = pytest.importorskip("ROOT") + + +compiler = ROOT.gInterpreter.Declare + + +def test_rdf_column_of_Long64_t_type(): + data_frame = ROOT.RDataFrame(10).Define("x", "(Long64_t)(gRandom->Rndm()*1000.)") + assert data_frame.GetColumnType("x") == "Long64_t" + + ak_array = ak.from_rdataframe( + data_frame, + columns="x", + ) + assert ak_array.layout.form == ak.forms.NumpyForm("int64")