Skip to content

cx_Oracle.CLOB compares as true to cx_Oracle.STRING, NATIVE_FLOAT == NUMBER in git master #415

@zzzeek

Description

@zzzeek

Hi there -

Reviewing our CI that tests against cx_Oracle master I have a few more things coming in.

The first is that the comparison behavior of cx_Oracle.CLOB seems to have changed. We have an outputtype handler that does logic like this:


if default_type in (cx_Oracle.STRING, cx_Oracle.FIXED_CHAR):
    # do something for strings
elif default_type in (cx_Oracle.CLOB, cx_Oracle.NCLOB):
   # do something for clobs

current cx_Oracle master vs. the released version of cx_Oracle 7.3.0 has changed the behavior of CLOB such that the above code no longer works as expected:

Python 3.7.6 (default, Jan 30 2020, 09:44:41) 
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>> cx_Oracle.__version__
'8.0.0-dev'
>>> cx_Oracle.CLOB == cx_Oracle.STRING
True

compare to current relased version 7.3.0:

Python 3.7.6 (default, Jan 30 2020, 09:44:41) 
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>> cx_Oracle.__version__
'7.3.0'
>>> cx_Oracle.CLOB == cx_Oracle.STRING
False

is this change in behavior intentional ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions