Skip to content

TYP: check_untyped_defs pandas/io/sql.py #30661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,8 @@ def read(self, coerce_float=True, parse_dates=None, columns=None, chunksize=None

cols = [self.table.c[n] for n in columns]
if self.index is not None:
[cols.insert(0, self.table.c[idx]) for idx in self.index[::-1]]
for idx in self.index[::-1]:
cols.insert(0, self.table.c[idx])
sql_select = select(cols)
else:
sql_select = self.table.select()
Expand Down Expand Up @@ -1447,7 +1448,8 @@ def insert_statement(self):
escape = _get_valid_sqlite_name

if self.index is not None:
[names.insert(0, idx) for idx in self.index[::-1]]
for idx in self.index[::-1]:
names.insert(0, idx)

bracketed_names = [escape(column) for column in names]
col_names = ",".join(bracketed_names)
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,6 @@ check_untyped_defs=False
[mypy-pandas.io.sas.sasreader]
check_untyped_defs=False

[mypy-pandas.io.sql]
check_untyped_defs=False

[mypy-pandas.io.stata]
check_untyped_defs=False

Expand Down