cannot import name 'NANOARROW_TIME_UNIT_SECOND' from 'oracledb.interchange.nanoarrow_bridge' #492
-
Running in a docker container using the docker image: docker.io/library/python:3.11.4-alpine3.17 With cython-0.29.37 Installed oracledb 3.1.0 Getting this error:
Not getting this error in other environments (that aren't running alpine). First gave me this error 3 days ago (10 May 2025). Was previously running with same docker image python:3.11.4-alpine3.17 , same cython-0.29.37 , same oracledb 3.1.0 , and it worked fine, I didn't get this error, 5 days ago (8 May 2025). Anyone please able to help? Currently blocking me from running all my CI builds, really need to resolve. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 4 replies
-
This got borked by the just-released Cython 3.1. Using the older Cython should work. @anthony-tuininga fixed the problem in our internal repo at the end of last week, and no doubt will push out the patch to GitHub's main branch this week. |
Beta Was this translation helpful? Give feedback.
-
@cjbj thanks for your prompt reply! I'm using Cython 0.29.37 (I pinned it to Like I said, I confirmed via build logs that my python core version, cython version, and python-oracledb version were unchanged, between when everything was working fine for me, and when this nanoarrow error started happening. Anyway, if you guys have a fix in the pipeline, looking forward to seeing it in main and in a release for python-oracledb sometime soon. |
Beta Was this translation helpful? Give feedback.
-
Just tried bumping Cython to 3.1.0 . Same error. |
Beta Was this translation helpful? Give feedback.
-
Tried Cython 3.0.12 . Same error. |
Beta Was this translation helpful? Give feedback.
-
I can reproduce the error in other environments if I force python-oracledb to install from source (in my case, using poetry, the command is |
Beta Was this translation helpful? Give feedback.
-
tl;dr: no matter what environment I'm in (and no matter the cython version), I get the nanoarrow error if I install python-oracledb from source. No nanoarrow error if I install python-oracledb from an official pre-built binary. Don't know what magic you guys are doing in github actions, that I'm not doing locally, to build a binary that doesn't result in that error. Wish I could use an official pre-built binary in my CI environment - but none of the pre-built binaries appears to be compatible with that python:3.11.4-alpine3.17 environment of mine. |
Beta Was this translation helpful? Give feedback.
-
Ahhh, figured it out... it doesn't use whatever cython version I have in my project's virtualenv when building python-oracledb from source... it creates its own separate virtualenv, and installs the cython version specified in python-oracledb's pyproject.toml . I changed python-oracledb's pyproject.toml (on my local machine) to specify Will see what I can do to get it installing like that in my CI environment. That will at least unblock me, until the python-oracledb guys release an official fix. |
Beta Was this translation helpful? Give feedback.
-
@Jaza On another topic, how are you finding python-oracledb on Alpine? I assume you are using Thin mode? |
Beta Was this translation helpful? Give feedback.
@Jaza, a patch has been pushed. I created a new issue #493 to track it further. Builds are in progress if you want to try those. We will discuss when the next release takes place.