From 8bee6290d2cc7514278de6c4abc64f015bfb23d5 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 21 Apr 2021 18:43:10 -0700 Subject: [PATCH] Check if df is empty before trying equality check for speed Co-authored-by: GALI PREM SAGAR --- python/cudf/cudf/core/dataframe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 492152e5151..30b6c307fbd 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -7953,7 +7953,7 @@ def _setitem_with_dataframe( "Number of Input Columns must be same replacement Dataframe" ) - if not input_df.index.equals(replace_df.index) and len(input_df) != 0: + if len(input_df) != 0 and not input_df.index.equals(replace_df.index): replace_df = replace_df.reindex(input_df.index) for col_1, col_2 in zip(input_cols, replace_df.columns):