You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm just looking for comments/interest on changing the error formatting for StatementError. I'm interested in making small changes at the two lines below:
Change %r to %s so that multi-line SQL statements appear formatted in a way that would be more quickly recognized by its author.
For example, this makes the difference between the two error messages:
sqlalchemy.exc.StatementError: (sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter 'id' [SQL: 'select * from reviews where id = %(id)s'] (Background on this error at: http://sqlalche.me/e/cd3x)
(sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter 'id' [SQL: 'select * from reviews where id = %(id)s'] (Background on this error at: http://sqlalche.me/e/cd3x)
becomes
sqlalchemy.exc.StatementError: (sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter 'id'
[SQL: (select * from reviews where id = %(id)s)]
(Background on this error at: http://sqlalche.me/e/cd3x)
(sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter 'id'
[SQL: (select * from reviews where id = %(id)s)]
(Background on this error at: http://sqlalche.me/e/cd3x)
If this sounds alright. I'd be happy to make a PR 😄
Thanks for your time.
The text was updated successfully, but these errors were encountered:
looks nicer but I worry the use case of grepping logs might be impacted. though the error message itself is still staying on one line so maybe it wont be so bad. we're right at the edge of me wanting to release 1.3.0 final so, that's where it would have to be. I'd be happy to evaluate a PR to see what it ends up looking like.
zzzeek
added
the
engine
engines, connections, transactions, isolation levels, execution options
label
Feb 14, 2019
Hey hey,
I'm just looking for comments/interest on changing the error formatting for
StatementError
. I'm interested in making small changes at the two lines below:%r
to%s
so that multi-line SQL statements appear formatted in a way that would be more quickly recognized by its author.sqlalchemy/lib/sqlalchemy/exc.py
Line 349 in 4d7ac4b
"\n"
instead of" "
in hopes of improved readabilitysqlalchemy/lib/sqlalchemy/exc.py
Line 356 in 4d7ac4b
For example, this makes the difference between the two error messages:
becomes
If this sounds alright. I'd be happy to make a PR 😄
Thanks for your time.
The text was updated successfully, but these errors were encountered: