You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by cu...@apache.org on 2025/07/14 15:32:36 UTC
(arrow-adbc) branch main updated: chore(csharp/test/Drivers/Databricks): Fix some test cases that have null catalog (#3139)
This is an automated email from the ASF dual-hosted git repository.
curth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 00be00e90 chore(csharp/test/Drivers/Databricks): Fix some test cases that have null catalog (#3139)
00be00e90 is described below
commit 00be00e9005a6ea273abee794b1eb288683413dc
Author: Jacky Hu <ja...@databricks.com>
AuthorDate: Mon Jul 14 08:32:31 2025 -0700
chore(csharp/test/Drivers/Databricks): Fix some test cases that have null catalog (#3139)
## Issue
In some test cases in `DatabricksConnectionTest` and `StatementTest` in
Databricks driver test, when catalog/schema is `null`, the test code
does not update the corresponding catalog/schema in `TestConfiguration`,
if the `catalog` or `schema` is non-empty in the original
`TestConfiguration`, the test case will fail
## Changes
- Updated
`DatabricksConnectionTest:SetDefaultCatalogAndSchemaOptionsTest` to set
catalog/schema in testConfig to `string.empty` when catalog/schema is
null
- Updated `StatementTest:ShouldReturnEmptyPkFkResult_WorksAsExpected` to
set statement's catalog to `string.empty` when it is null
## Testing
- `Apache.Arrow.Adbc.Tests.Drivers.Databricks.DatabricksConnectionTest`
- `Apache.Arrow.Adbc.Tests.Drivers.Databricks.StatementTest`
---
.../Drivers/Databricks/E2E/DatabricksConnectionTest.cs | 18 ++++++++++++++++--
csharp/test/Drivers/Databricks/E2E/StatementTests.cs | 4 ++++
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/csharp/test/Drivers/Databricks/E2E/DatabricksConnectionTest.cs b/csharp/test/Drivers/Databricks/E2E/DatabricksConnectionTest.cs
index 72171d781..b564ad381 100644
--- a/csharp/test/Drivers/Databricks/E2E/DatabricksConnectionTest.cs
+++ b/csharp/test/Drivers/Databricks/E2E/DatabricksConnectionTest.cs
@@ -373,8 +373,22 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.Databricks
var testConfig = (DatabricksTestConfiguration)TestConfiguration.Clone();
testConfig.EnableMultipleCatalogSupport = enableMultipleCatalogSupport;
- if (inputCatalog is not null) testConfig.Catalog = inputCatalog;
- if (inputSchema is not null) testConfig.DbSchema = inputSchema;
+ if (inputCatalog is not null)
+ {
+ testConfig.Catalog = inputCatalog;
+ }
+ else
+ {
+ testConfig.Catalog = string.Empty;
+ }
+ if (inputSchema is not null)
+ {
+ testConfig.DbSchema = inputSchema;
+ }
+ else
+ {
+ testConfig.DbSchema = string.Empty;
+ }
var connection = NewConnection(testConfig);
var statement = connection.CreateStatement();
diff --git a/csharp/test/Drivers/Databricks/E2E/StatementTests.cs b/csharp/test/Drivers/Databricks/E2E/StatementTests.cs
index bc1e0e22a..f37d8c6a4 100644
--- a/csharp/test/Drivers/Databricks/E2E/StatementTests.cs
+++ b/csharp/test/Drivers/Databricks/E2E/StatementTests.cs
@@ -1123,6 +1123,10 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.Databricks
{
statement.SetOption(ApacheParameters.CatalogName, catalogName);
}
+ else
+ {
+ statement.SetOption(ApacheParameters.CatalogName, string.Empty);
+ }
// Act
var result = ((DatabricksStatement)statement).ShouldReturnEmptyPkFkResult();