Comments (2)
Hi - It seems like a field called "errorClass" was removed from the error response. This wasn't intended. Can you give the response from Druid API that your test is getting?
from pydruid.
This is still broken in Druid 28 for the same reason (Ibis CI run: https://github.com/ibis-project/ibis/actions/runs/6871306008/job/18688017127?pr=7551).
I've put up a PR to address this issue here: #308
Here's the traceback from one of our failing tests:
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1385: in execute
return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/sqlalchemy/sql/compiler.py:476: in _execute_on_connection
return connection._execute_compiled(
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1630: in _execute_compiled
ret = self._execute_context(
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1953: in _execute_context
self._handle_dbapi_exception(
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py:2138: in _handle_dbapi_exception
util.raise_(exc_info[1], with_traceback=exc_info[2])
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/sqlalchemy/util/compat.py:211: in raise_
raise exception
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1910: in _execute_context
self.dialect.do_execute(
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/sqlalchemy/engine/default.py:736: in do_execute
cursor.execute(statement, parameters)
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/pydruid/db/api.py:62: in g
return f(self, *args, **kwargs)
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/pydruid/db/api.py:256: in execute
first_row = next(results)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pydruid.db.api.Cursor object at 0x7f55cf650970>
query = 'SELECT sum(CAST("INFORMATION_SCHEMA"."TABLES"."TABLE_NAME" = \'_ibis_test_table_7jiw7mdxhfhdtdg7eio5xjknhu\' AS INTEGER)) AS "sum_1" \nFROM "INFORMATION_SCHEMA"."TABLES"'
def _stream_query(self, query):
"""
Stream rows from a query.
This method will yield rows as the data is returned in chunks from the
server.
"""
self.description = None
headers = {"Content-Type": "application/json"}
payload = {"query": query, "context": self.context, "header": self.header}
auth = (
requests.auth.HTTPBasicAuth(self.user, self.password) if self.user else None
)
r = requests.post(
self.url,
stream=True,
headers=headers,
json=payload,
auth=auth,
verify=self.ssl_verify_cert,
cert=self.ssl_client_cert,
proxies=self.proxies,
)
if r.encoding is None:
r.encoding = "utf-8"
# raise any error messages
if r.status_code != 200:
try:
payload = r.json()
except Exception:
payload = {
"error": "Unknown error",
"errorClass": "Unknown",
"errorMessage": r.text,
}
> msg = "{error} ({errorClass}): {errorMessage}".format(**payload)
E KeyError: 'errorClass'
/nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/pydruid/db/api.py:362: KeyError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>
> /nix/store/hxwgw8y74c2hy3ap7m2kwa093a8r2cr8-python3-3.10.13-env/lib/python3.10/site-packages/pydruid/db/api.py(362)_stream_query()
-> msg = "{error} ({errorClass}): {errorMessage}".format(**payload)
Here's the value of payload
:
(Pdb) payload
{'error': 'druidException', 'errorCode': 'invalidInput', 'persona': 'USER', 'category': 'INVALID_INPUT', 'errorMessage': 'Cast function cannot convert value of type BOOLEAN to type INTEGER (line [1], column [12])', 'context': {'sourceType': 'sql', 'line': '1', 'column': '12', 'endLine': '1', 'endColumn': '118'}}
Hopefully it's clear that errorClass
is missing.
from pydruid.
Related Issues (20)
- JSONDecodeError: Expecting ',' delimiter: line 1 column 7060430653 (char 7060430652)
- Evaluating query runtime without output HOT 1
- PyDruid for Data Ingestion in Druid HOT 2
- Version 0.6.3 is broken if you don't already have sqlalchemy installed
- Getting columns for a Druid datasource fails with a KeyError HOT 2
- Subquery not getting converted property HOT 2
- "do_ping" broken in last pydruid release, can't add a Druid as a new Database in Superset, need a pydruid release HOT 10
- Support newer Python versions
- ssl_client_cert passed is being assigned to proxies in Cursor object
- Support for multi-stage-query (sql-msq-task) HOT 1
- Is there a way to query for stats aggregator (STDDEV)?
- Pandas 2.0 dtype_backend="pyarrow"
- Column name not identified on certain special characters
- Querying list of data sources HOT 2
- Is this project currently maintained?
- Error when calling the async client
- inadvertent hard dependency on sqlalchemy
- Row counter
- dependent on prompt-toolkit version 1 however prompt-toolkit version 3.0.30 is required HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydruid.