Closed john-bodley closed 5 years ago
Additionally it resolves an issue which surfaced by adding unit tests caused by the fact that a bool is an instance of int, i.e.,
WTF, I thought this was fixed a long time ago in Python. (IIRC initially False
and True
were simply aliases to 0 and 1.)
@betodealmeida I also wasn't aware that was the case. The reason is explained here and the solution implemented uses the same logic they suggest.
This PR fixes an issue where the SQL statement contains a
%
character (possibly in an alias) where and when no parameters are specified the following is problematic,The fix uses the same logic as PyHive and only formats the operation (using the pyformat convention) if parameters exist.
Additionally it resolves an issue which surfaced by adding unit tests caused by the fact that a
bool
is an instance ofint
, i.e.,and thus booleans weren't being escaped correctly.
to: @betodealmeida @mistercrunch