Repository navigation
Closed
Labels
Description
- What versions are you using?
Give your Oracle Database version, e.g.:
19.25.0.0.0
Give your Oracle Client version (if you are using Thick mode):
(19, 25, 0, 0, 0)
Python version:
platform.platform: Linux-5.15.0-210.163.7.el9uek.x86_64-x86_64-with-glibc2.34
sys.maxsize > 2**32: True
platform.python_version: 3.13.9
oracledb.version: 3.4.1
- Is it an error or a hang or a crash?
I'm encountering an error when trying to batch insert a data frame into a table
- What error(s) or behavior you are seeing?
oracledb.exceptions.NotSupportedError: DPY-3032: conversion from Apache Arrow format "n" to Oracle Database is not supported
It's not really clear how to deal with None values in a DataFrame.
Converting None values to empty strings resolves the issue, but probably (?) only for text-like (varchar2, ...) columns.
Output:
==> OracleDB clientversion
(19, 25, 0, 0, 0)
truncate table DEST
A B C
0 X 0 None
1 X 1 None
<class 'pandas.core.frame.DataFrame'>
insert into DEST (A,B,C) values (:1,:2,:3)
Traceback (most recent call last):
File "/home/oracle/python/tas/test.py", line 35, in <module>
cursor.executemany(insert_stmt, df)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/oracle/python/tas/.venv/lib64/python3.13/site-packages/oracledb/cursor.py", line 916, in executemany
manager = self._impl._prepare_for_executemany(
self,
...<2 lines>...
batch_size,
)
File "src/oracledb/impl/base/cursor.pyx", line 454, in oracledb.base_impl.BaseCursorImpl._prepare_for_executemany
File "src/oracledb/impl/base/batch_load_manager.pyx", line 148, in oracledb.base_impl.BatchLoadManager.create_for_executemany
File "src/oracledb/impl/base/batch_load_manager.pyx", line 70, in oracledb.base_impl.BatchLoadManager._create
File "src/oracledb/impl/arrow/dataframe.pyx", line 61, in oracledb.arrow_impl.DataFrameImpl.from_arrow_stream
File "src/oracledb/impl/arrow/schema.pyx", line 190, in oracledb.arrow_impl.ArrowSchemaImpl.populate_from_schema
File "/home/oracle/python/tas/.venv/lib64/python3.13/site-packages/oracledb/errors.py", line 199, in _raise_err
raise error.exc_type(error) from cause
oracledb.exceptions.NotSupportedError: DPY-3032: conversion from Apache Arrow format "n" to Oracle Database is not supported
- Does your application call init_oracle_client()?
Yes
oracledb.init_oracle_client()
- Include a runnable Python script that shows the problem.
DDL:
CREATE TABLE "STAGING"."DEST"
( "A" VARCHAR2(15 CHAR),
"B" NUMBER(1,0),
"C" VARCHAR2(50 CHAR)
) ;
import os
from dotenv import load_dotenv
import pandas as pd
import oracledb
load_dotenv()
oracledb.init_oracle_client()
print("==> OracleDB clientversion")
print(oracledb.clientversion())
ora_con = oracledb.connect(
user=os.getenv("DB_USER"),
password=os.getenv("DB_PW"),
dsn=os.getenv("DB_DSN")
)
truncate_stmt = f"truncate table DEST"
print(truncate_stmt)
cursor = ora_con.cursor()
cursor.execute(truncate_stmt)
df = pd.DataFrame({"A":["X","X"],"B":[0,1],"C":[None,None]}, index=[0,1])
insert_stmt = f"insert into DEST (A,B,C) values (:1,:2,:3) "
print(df)
print(type(df))
print(insert_stmt)
with ora_con.cursor() as cursor:
cursor.executemany(insert_stmt, df)
ora_con.commit()
I didn't find documentation about how to treat None/Null values.
Thank you for your feedback
Bart
Activity
Added support for ingesting Arrow arrays which only consist of null
anthony-tuininga commentedon Jan 21, 2026
I have pushed a patch that should correct this issue and have initated a build from which you can download pre-built development wheels once it completes. You can also build from source if you prefer. If you can test your scenario and confirm the patch works as expected, that would be appreciated!
Added support for ingesting Arrow arrays which only consist of null
anthony-tuininga commentedon Jan 23, 2026
I have initiated a new build on the
v3.4.xbranch in preparation for the release of python-oracledb 3.4.2.anthony-tuininga commentedon Jan 28, 2026
This was included in python-oracledb 3.4.2 which was just released.