Skip to content

Query returns something other than what query asked for - possible error message not parsed? #550

@rzvcs

Description

@rzvcs
  • vertica-python==1.3.8
  • vertica 11.x
  • sqlalchemy-vertica-python v.0.5.10
  • pandas==2.1.4

In our code, we have several workers running simple queries such as below. However, we started seeing errors where pandas had a difficulty wrapping the result into a dataframe with specific dtype for columns, throwing this error
KeyError: "Only a column name can be used for the key in a dtype mappings argument. 'ts' not found in columns."

We believe that this might have been caused by high load on the Vertica service, where the resource pool might have been exceeded. It could also have been a red herring, hence, why I am reaching out for some insights. When we reran the process only for the uuids for which we had this issue, code execution passed without errors.

Are there messages returned by Vertica which are not considered errors in vertica-python?
Or are not all vertica errors thrown by vertica-python?
Or is there something else that could have happened in this scenario, not covered by vertica-python?

Code:

# For reference: sql_con: sqlalchemy.engine.Connection
stmt = (
   sqlalchemy.select(ExceptionTable.ts, ExceptionTable.severity)
   .where(ExceptionTable.uuid == uuid)
   .where(ExceptionTable.ts >= select_ts_start)
   .where(ExceptionTable.ts <= select_ts_end)
   .order_by(ExceptionTable.ts.asc())
 )
 window_df = pd.read_sql_query(
   sql=stmt, con=sql_con, dtype={"ts": "datetime64[ns]", "severity": "int32"}
 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions