From ac77b678071de00d4e4062f0a37038af65d99f4c Mon Sep 17 00:00:00 2001 From: Joshua Landwehr Date: Tue, 10 Feb 2026 14:37:43 -0800 Subject: [PATCH 1/2] Allow newer versions of arrow odbc and fix tests that return time field. --- docs/requirements.txt | 2 +- setup.cfg | 2 +- test/test_odbc_connector.py | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 912959c..817ebc6 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -6,5 +6,5 @@ pyarrow neo4j xgt pandas -arrow_odbc==0.2.0 +arrow_odbc antlr4-python3-runtime diff --git a/setup.cfg b/setup.cfg index 616d6ff..0997046 100644 --- a/setup.cfg +++ b/setup.cfg @@ -64,5 +64,5 @@ install_requires = where = src [options.extras_require] -odbc = arrow_odbc==0.2.0 +odbc = arrow_odbc pandas diff --git a/test/test_odbc_connector.py b/test/test_odbc_connector.py index dddd172..e9a1a8d 100644 --- a/test/test_odbc_connector.py +++ b/test/test_odbc_connector.py @@ -48,7 +48,7 @@ def teardown_class(cls): @classmethod def _setup_connector(cls): - connection_string = 'Driver={MariaDB};Server=127.0.0.1;Port=3306;Database=test;Uid=test;Pwd=foo;' + connection_string = 'Driver={MariaDB};Server=127.0.0.1;Port=3306;Database=test;Uid=test;Pwd=test;' odbc_driver = pyodbc.connect(connection_string) driver = SQLODBCDriver(connection_string) conn = ODBCConnector(cls.xgt, driver) @@ -83,7 +83,7 @@ def test_transfer(self): result = [[1, 32, 5000, 1.7, 1.98, 'vdxs', 'String', 1.78976, date(year = 1989, month = 5, day = 6), datetime(year = 1986, month = 5, day = 6, hour = 12, minute = 56, second = 34), datetime(year = 1989, month = 5, day = 6, hour = 12, minute = 56, second = 34), - '12:56:34', 1999], [None, None, None, None, None, None, None, None, None, None, None, None, None]] + time(12, 56, 34), 1999], [None, None, None, None, None, None, None, None, None, None, None, None, None]] cursor = self.odbc_driver.cursor() cursor.execute("CREATE TABLE test (TestBool BOOL, TestInt INT, TestBigInt BIGINT, TestFloat FLOAT(24), TestDouble FLOAT(53), " "TestFixedString char(5), TestString varchar(255), TestDecimal DECIMAL(10, 6), TestDate DATE, " @@ -357,8 +357,8 @@ def test_transfer_to_odbc(self): result = [[1, 32, 5000, 1.7, 1.98, 'vdxs', 'String', 1.78976, date(year = 1989, month = 5, day = 6), datetime(year = 1986, month = 5, day = 6, hour = 12, minute = 56, second = 34), datetime(year = 1989, month = 5, day = 6, hour = 12, minute = 56, second = 34), - '12:56:34', 1999]] - #'12:56:34', 1999], [None, None, None, None, None, None, None, None, None, None, None, None, None]] + time(12, 56, 34), 1999]] + #time(12, 56, 34), 1999], [None, None, None, None, None, None, None, None, None, None, None, None, None]] cursor = self.odbc_driver.cursor() create_statement = """CREATE TABLE test (TestBool BOOL, TestInt INT, TestBigInt BIGINT, TestFloat FLOAT(24), TestDouble FLOAT(53), TestFixedString char(5), TestString varchar(255), TestDecimal DECIMAL(10, 6), TestDate DATE, @@ -381,7 +381,7 @@ def test_transfer_to_odbc_rename(self): result = [[1, 32, 5000, 1.7, 1.98, 'vdxs', 'String', 1.78976, date(year = 1989, month = 5, day = 6), datetime(year = 1986, month = 5, day = 6, hour = 12, minute = 56, second = 34), datetime(year = 1989, month = 5, day = 6, hour = 12, minute = 56, second = 34), - '12:56:34', 1999]] + time(12, 56, 34), 1999]] cursor = self.odbc_driver.cursor() create_statement = """CREATE TABLE test (TestBool BOOL, TestInt INT, TestBigInt BIGINT, TestFloat FLOAT(24), TestDouble FLOAT(53), TestFixedString char(5), TestString varchar(255), TestDecimal DECIMAL(10, 6), TestDate DATE, @@ -403,7 +403,7 @@ def test_transfer_to_odbc_vertex(self): result = [[1, 32, 5000, 1.7, 1.98, 'vdxs', 'String', 1.78976, date(year = 1989, month = 5, day = 6), datetime(year = 1986, month = 5, day = 6, hour = 12, minute = 56, second = 34), datetime(year = 1989, month = 5, day = 6, hour = 12, minute = 56, second = 34), - '12:56:34', 1999]] + time(12, 56, 34), 1999]] cursor = self.odbc_driver.cursor() create_statement = """CREATE TABLE test (TestBool BOOL, TestInt INT, TestBigInt BIGINT, TestFloat FLOAT(24), TestDouble FLOAT(53), TestFixedString char(5), TestString varchar(255), TestDecimal DECIMAL(10, 6), TestDate DATE, @@ -425,7 +425,7 @@ def test_transfer_to_odbc_vertex_rename(self): result = [[1, 32, 5000, 1.7, 1.98, 'vdxs', 'String', 1.78976, date(year = 1989, month = 5, day = 6), datetime(year = 1986, month = 5, day = 6, hour = 12, minute = 56, second = 34), datetime(year = 1989, month = 5, day = 6, hour = 12, minute = 56, second = 34), - '12:56:34', 1999]] + time(12, 56, 34), 1999]] cursor = self.odbc_driver.cursor() create_statement = """CREATE TABLE test (TestBool BOOL, TestInt INT, TestBigInt BIGINT, TestFloat FLOAT(24), TestDouble FLOAT(53), TestFixedString char(5), TestString varchar(255), TestDecimal DECIMAL(10, 6), TestDate DATE, @@ -447,7 +447,7 @@ def test_transfer_to_odbc_edges(self): result = [[1, 32, 5000, 1.7, 1.98, 'vdxs', 'String', 1.78976, date(year = 1989, month = 5, day = 6), datetime(year = 1986, month = 5, day = 6, hour = 12, minute = 56, second = 34), datetime(year = 1989, month = 5, day = 6, hour = 12, minute = 56, second = 34), - '12:56:34', 1999]] + time(12, 56, 34), 1999]] cursor = self.odbc_driver.cursor() create_statement = """CREATE TABLE test (TestBool BOOL, TestInt INT, TestBigInt BIGINT, TestFloat FLOAT(24), TestDouble FLOAT(53), TestFixedString char(5), TestString varchar(255), TestDecimal DECIMAL(10, 6), TestDate DATE, @@ -469,7 +469,7 @@ def test_transfer_to_odbc_edges_rename(self): result = [[1, 32, 5000, 1.7, 1.98, 'vdxs', 'String', 1.78976, date(year = 1989, month = 5, day = 6), datetime(year = 1986, month = 5, day = 6, hour = 12, minute = 56, second = 34), datetime(year = 1989, month = 5, day = 6, hour = 12, minute = 56, second = 34), - '12:56:34', 1999]] + time(12, 56, 34), 1999]] cursor = self.odbc_driver.cursor() create_statement = """CREATE TABLE test (TestBool BOOL, TestInt INT, TestBigInt BIGINT, TestFloat FLOAT(24), TestDouble FLOAT(53), TestFixedString char(5), TestString varchar(255), TestDecimal DECIMAL(10, 6), TestDate DATE, @@ -491,7 +491,7 @@ def test_transfer_query(self): result = [[1, 32, 5000, 1.7, 1.98, 'vdxs', 'String', 1.78976, date(year = 1989, month = 5, day = 6), datetime(year = 1986, month = 5, day = 6, hour = 12, minute = 56, second = 34), datetime(year = 1989, month = 5, day = 6, hour = 12, minute = 56, second = 34), - '12:56:34', 1999], [None, None, None, None, None, None, None, None, None, None, None, None, None]] + time(12, 56, 34), 1999], [None, None, None, None, None, None, None, None, None, None, None, None, None]] cursor = self.odbc_driver.cursor() cursor.execute("CREATE TABLE test (TestBool BOOL, TestInt INT, TestBigInt BIGINT, TestFloat FLOAT(24), TestDouble FLOAT(53), " "TestFixedString char(5), TestString varchar(255), TestDecimal DECIMAL(10, 6), TestDate DATE, " From 6a78d5e151835dd7c8172abb579febb0f19523b0 Mon Sep 17 00:00:00 2001 From: Joshua Landwehr Date: Tue, 10 Feb 2026 15:02:53 -0800 Subject: [PATCH 2/2] Fix test database password. --- test/test_odbc_connector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_odbc_connector.py b/test/test_odbc_connector.py index e9a1a8d..cedce3a 100644 --- a/test/test_odbc_connector.py +++ b/test/test_odbc_connector.py @@ -48,7 +48,7 @@ def teardown_class(cls): @classmethod def _setup_connector(cls): - connection_string = 'Driver={MariaDB};Server=127.0.0.1;Port=3306;Database=test;Uid=test;Pwd=test;' + connection_string = 'Driver={MariaDB};Server=127.0.0.1;Port=3306;Database=test;Uid=test;Pwd=foo;' odbc_driver = pyodbc.connect(connection_string) driver = SQLODBCDriver(connection_string) conn = ODBCConnector(cls.xgt, driver)