query: Add a user hint for query TypeErrors.
The error message that native bean-query provides when this happens confuses many users. Add a hint to point them in the right direction.
This commit is contained in:
parent
c5a2c2d39b
commit
ea10fb239f
1 changed files with 9 additions and 0 deletions
|
@ -238,6 +238,15 @@ class BQLShell(bc_query_shell.BQLShell):
|
||||||
)
|
)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
logger.error(str(error), exc_info=logger.isEnabledFor(logging.DEBUG))
|
logger.error(str(error), exc_info=logger.isEnabledFor(logging.DEBUG))
|
||||||
|
if (isinstance(error, TypeError)
|
||||||
|
and error.args
|
||||||
|
and ' not supported between instances ' in error.args[0]):
|
||||||
|
logger.info(
|
||||||
|
"HINT: Are you using ORDER BY or comparisons with metadata "
|
||||||
|
"that isn't consistently set?\n "
|
||||||
|
"Try looking up that metadata with str_meta() instead to "
|
||||||
|
"ensure your comparisons use a consistent data type.",
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not rows and output_format != 'ods':
|
if not rows and output_format != 'ods':
|
||||||
|
|
Loading…
Reference in a new issue