From 54740186bf63984a22b2813a263151c4f33b14f8 Mon Sep 17 00:00:00 2001 From: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com> Date: Fri, 30 Jul 2021 11:03:44 -0700 Subject: [PATCH] Avoid index equality check in from_py_table --- python/cudf/cudf/_lib/copying.pyx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/cudf/cudf/_lib/copying.pyx b/python/cudf/cudf/_lib/copying.pyx index 87a8aeaaa26..d114a04eec4 100644 --- a/python/cudf/cudf/_lib/copying.pyx +++ b/python/cudf/cudf/_lib/copying.pyx @@ -795,8 +795,11 @@ cdef class _CPackedColumns: cdef _CPackedColumns p = _CPackedColumns.__new__(_CPackedColumns) - if keep_index and not input_table.index.equals( - RangeIndex(start=0, stop=len(input_table), step=1) + if keep_index and ( + not isinstance(input_table.index, RangeIndex) + or input_table.index.start != 0 + or input_table.index.stop != len(input_table) + or input_table.index.step != 1 ): input_table_view = input_table.view() p.index_names = input_table._index_names