-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
fstring in io.sql #30026
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
fstring in io.sql #30026
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Looks good and I think CI failures are unrelated / have been fixed on master since this was created.
To be sure, can you locally on your shiny-new-feature
branch run:
git fetch upstream
git merge upstream/master
git push origin shiny-new-feature
I think should get CI green for this. Flag me down at PyData if you have any questions
pandas/io/sql.py
Outdated
"Length of 'index_label' should match number of " | ||
"levels, which is {0}".format(nlevels) | ||
f"Length of 'index_label' should match number of " | ||
"levels, which is {nlevels}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line needs an f
pandas/io/sql.py
Outdated
"The type of {column} is not a " | ||
"SQLAlchemy type ".format(column=col) | ||
) | ||
raise ValueError(f"The type of {col} is not a " "SQLAlchemy type ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise ValueError(f"The type of {col} is not a " "SQLAlchemy type ") | |
raise ValueError(f"The type of {col} is not a SQLAlchemy type ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove trailing space?
pandas/io/sql.py
Outdated
@@ -1599,14 +1588,11 @@ def execute(self, *args, **kwargs): | |||
self.con.rollback() | |||
except Exception as inner_exc: # pragma: no cover | |||
ex = DatabaseError( | |||
"Execution failed on sql: {sql}\n{exc}\nunable " | |||
"to rollback".format(sql=args[0], exc=exc) | |||
f"Execution failed on sql: {args[0]}\n{exc}\nunable " "to rollback" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f"Execution failed on sql: {args[0]}\n{exc}\nunable " "to rollback" | |
f"Execution failed on sql: {args[0]}\n{exc}\nunable to rollback" |
pandas/io/sql.py
Outdated
column=col, type=my_type | ||
) | ||
) | ||
raise ValueError(f"{col} ({my_type!s}) not a string") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the !s
required here?
@lexy-lixinyu can you commit changes as suggested by @simonjayhawkins ? |
just pushed edits removing unintentional " " in two places. |
Thanks for the work on this @lexy-lixinyu, can you address the two last comments, and update your branch from master please? This is ready to be merged after it. If you need help let us know. |
just pushed edits to address outstanding comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thanks @lexy-lixinyu and @jbrockmendel |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff