|
25 | 25 | from behave import given, when, then |
26 | 26 |
|
27 | 27 | os.environ["DATABEND_DRIVER_HEARTBEAT_INTERVAL_SECONDS"] = "1" |
28 | | -os.environ["RUST_LOG"] = "warn,databend_driver=debug,databend_client=debug" |
| 28 | +os.environ.setdefault( |
| 29 | + "RUST_LOG", |
| 30 | + "warn", |
| 31 | +) |
| 32 | +os.environ.setdefault("RUST_BACKTRACE", "1") |
29 | 33 | import databend_driver |
30 | 34 |
|
31 | 35 | NOW = int(time.time()) |
@@ -115,9 +119,11 @@ def _(context): |
115 | 119 | row = context.conn.query_row("select to_binary('xyz')") |
116 | 120 | assert row.values() == (b"xyz",), f"Binary: {row.values()}" |
117 | 121 |
|
118 | | - # Interval |
119 | | - row = context.conn.query_row("select to_interval('1 microseconds')") |
120 | | - assert row.values() == (timedelta(microseconds=1),), f"Interval: {row.values()}" |
| 122 | + # Older drivers decode a one-microsecond interval as one millisecond. |
| 123 | + if DRIVER_VERSION >= (0, 28, 0): |
| 124 | + # Interval |
| 125 | + row = context.conn.query_row("select to_interval('1 microseconds')") |
| 126 | + assert row.values() == (timedelta(microseconds=1),), f"Interval: {row.values()}" |
121 | 127 |
|
122 | 128 | # Decimal |
123 | 129 | row = context.conn.query_row("SELECT 15.7563::Decimal(8,4), 2.0+3.0", params=[8, 4]) |
@@ -310,6 +316,11 @@ def _(context): |
310 | 316 |
|
311 | 317 |
|
312 | 318 | def test_load_file(context, load_method): |
| 319 | + # The load method argument replaced format_options/copy_options in v0.28.0. |
| 320 | + if DRIVER_VERSION < (0, 28, 0): |
| 321 | + print("SKIP: load_file method requires driver >= 0.28.0") |
| 322 | + return |
| 323 | + |
313 | 324 | if DRIVER_VERSION >= (0, 28, 3) and DB_VERSION >= (1, 2, 792): |
314 | 325 | context.conn.exec("CREATE OR REPLACE DATABASE db1") |
315 | 326 | context.conn.exec("use db1") |
|
0 commit comments