[Python] Connectorx - cx.read_sql() returns dataframe of all zeros rows intermittently or...

Discussão em 'Python' iniciado por Stack, Abril 11, 2025.

  1. Stack

    Stack Membro Participativo

    When using

    df = connectorx.read_sql(conn=cx_con, query=f"SELECT * FROM table;")


    I occasionally get a Dataframe returned with the correct columns, but all the rows are zeros or it crashes with the message


    Process finished with exit code -1073741819 (0xC0000005)
    ​

    This only happens when the table is being updated at the same time with df.to_sql("table", con=con_in, if_exists="append")

    My program reads a table from a local database that I am continuously updating in a concurrently running program. This issue does not occur when I try to read from the table using pandas.read_sql_query() (which is far slower). This indicates that there is some issue with the handling of the read/write traffic accessing the table when using connectorx that does not exist with the pandas read. Is this a bug with connectorx or is there something I can do to prevent this from happening?

    I'm using PyCharm 2022.2.1, Windows11, and Python 3.10

    Continue reading...

Compartilhe esta Página