From 41306c1829a22f0e8654f8d75dc23ce766c26ea8 Mon Sep 17 00:00:00 2001 From: McToel Date: Sun, 16 May 2021 11:11:06 +0200 Subject: [PATCH 2/2] fix index_col duplication if index_col is type str Signed-off-by: Elliott Sales de Andrade --- dask/dataframe/io/sql.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dask/dataframe/io/sql.py b/dask/dataframe/io/sql.py index 6573a325..9c15360c 100644 --- a/dask/dataframe/io/sql.py +++ b/dask/dataframe/io/sql.py @@ -125,10 +125,8 @@ def read_sql_table( if columns else list(table.columns) ) - if index_col not in columns: - columns.append( - table.columns[index_col] if isinstance(index_col, str) else index_col - ) + if index not in columns: + columns.append(index) if isinstance(index_col, str): kwargs["index_col"] = index_col -- 2.31.1