Skip to content

Commit 00be00e

Browse files
authored
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`
1 parent 442dce1 commit 00be00e

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

csharp/test/Drivers/Databricks/E2E/DatabricksConnectionTest.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,22 @@ public async Task SetDefaultCatalogAndSchemaOptionsTest(string? inputCatalog, st
373373
var testConfig = (DatabricksTestConfiguration)TestConfiguration.Clone();
374374
testConfig.EnableMultipleCatalogSupport = enableMultipleCatalogSupport;
375375

376-
if (inputCatalog is not null) testConfig.Catalog = inputCatalog;
377-
if (inputSchema is not null) testConfig.DbSchema = inputSchema;
376+
if (inputCatalog is not null)
377+
{
378+
testConfig.Catalog = inputCatalog;
379+
}
380+
else
381+
{
382+
testConfig.Catalog = string.Empty;
383+
}
384+
if (inputSchema is not null)
385+
{
386+
testConfig.DbSchema = inputSchema;
387+
}
388+
else
389+
{
390+
testConfig.DbSchema = string.Empty;
391+
}
378392

379393
var connection = NewConnection(testConfig);
380394
var statement = connection.CreateStatement();

csharp/test/Drivers/Databricks/E2E/StatementTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,10 @@ public void ShouldReturnEmptyPkFkResult_WorksAsExpected(bool enablePKFK, string?
11231123
{
11241124
statement.SetOption(ApacheParameters.CatalogName, catalogName);
11251125
}
1126+
else
1127+
{
1128+
statement.SetOption(ApacheParameters.CatalogName, string.Empty);
1129+
}
11261130

11271131
// Act
11281132
var result = ((DatabricksStatement)statement).ShouldReturnEmptyPkFkResult();

0 commit comments

Comments
 (0)