Skip to content

Commit b11637d

Browse files
committed
Try setting format_null_as_str=0
* This is ugly, should be set global on the database or connection string
1 parent f1ba129 commit b11637d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from sqlalchemy.dialects import registry
2+
from sqlalchemy import event, Engine, text
23
import pytest
34

45
registry.register("databend.databend", "databend_sqlalchemy.databend_dialect", "DatabendDialect")
@@ -7,3 +8,10 @@
78
pytest.register_assert_rewrite("sa.testing.assertions")
89

910
from sqlalchemy.testing.plugin.pytestplugin import *
11+
12+
13+
@event.listens_for(Engine, "connect")
14+
def receive_engine_connect(conn, r):
15+
cur = conn.cursor()
16+
cur.execute('SET format_null_as_str = 0')
17+
cur.close()

0 commit comments

Comments
 (0)