connector-x
connector-x copied to clipboard
Support for MYSQL_TYPE_NULL
What language are you using? Python 3.11
What version are you using? 0.3.2a5
What database are you using? MySQL
What dataframe are you using? Polars/Polars2
Can you describe your feature request? Currently, I am unable to query a table in my database due to the presence of MYSQL_TYPE_NULLS. Added support for this would be amazing.
I get the error:
thread '<unnamed>' panicked at 'not implemented: MYSQL_TYPE_NULL', /Users/runner/work/connector-x/connector-x/connectorx/src/sources/mysql/typesystem.rs:119:18
Example query / code
import connectorx as cx
import polars as pl
import pandas as pd
query = "SELECT * FROM table_name"
url = "mysql://{user}:{pw}@{server}:{port}/{db}"
df = cx.read_sql(url, query)
# error also occurs when I run: df = pl.read_database(query, url)
What is the error?
thread '<unnamed>' panicked at 'not implemented: MYSQL_TYPE_NULL', /Users/runner/work/connector-x/connector-x/connectorx/src/sources/mysql/typesystem.rs:119:18
---------------------------------------------------------------------------
PanicException Traceback (most recent call last)
Cell In[448], line 1
----> 1 cx.read_sql(url, query, return_type="arrow2")
File ~..../lib/python3.11/site-packages/connectorx/__init__.py:297, in read_sql(conn, query, return_type, protocol, partition_on, partition_range, partition_num, index_col)
294 except ModuleNotFoundError:
295 raise ValueError("You need to install pyarrow first")
--> 297 result = _read_sql(
298 conn,
299 "arrow2" if return_type in {"arrow2", "polars", "polars2"} else "arrow",
300 queries=queries,
301 protocol=protocol,
302 partition_query=partition_query,
303 )
304 df = reconstruct_arrow(result)
305 if return_type in {"polars", "polars2"}:
PanicException: not implemented: MYSQL_TYPE_NULL