python-dask/0002-fix-index_col-duplication-if-index_col-is-type-str.patch

31 lines
944 B
Diff
Raw Normal View History

2021-08-14 08:56:37 +00:00
From 41306c1829a22f0e8654f8d75dc23ce766c26ea8 Mon Sep 17 00:00:00 2001
2021-06-20 06:20:01 +00:00
From: McToel <theo.doellmann@gmx.de>
Date: Sun, 16 May 2021 11:11:06 +0200
2021-07-26 09:21:06 +00:00
Subject: [PATCH 2/2] fix index_col duplication if index_col is type str
2021-06-20 06:20:01 +00:00
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
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
2021-07-26 09:21:06 +00:00
index 6573a325..9c15360c 100644
2021-06-20 06:20:01 +00:00
--- 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