Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ repos:
pass_filenames: true
files: '(^\.pre-commit-config\.yaml$)|(^\.github/workflows/.*\.(yml|yaml)$)'
entry: "./ci/scripts/run_pre_commit_pin.py"
- id: dotnet-format
name: C# Format
language: system
entry: |
dotnet format csharp/Apache.Arrow.Adbc.sln --verify-no-changes
always_run: true
pass_filenames: false
- repo: https://github.com/doublify/pre-commit-rust
rev: eeee35a89e69d5772bdee97db1a6a898467b686e # v1.0
hooks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public static class IArrowArrayExtensions
((Decimal256Array)array).GetString(index) :
((StringArray)array).GetString(index);
case ArrowTypeId.LargeString:
return (array, index) =>((LargeStringArray)array).GetString(index);
return (array, index) => ((LargeStringArray)array).GetString(index);
#if NET6_0_OR_GREATER
case ArrowTypeId.Time32:
return (array, index) => ((Time32Array)array).GetTime(index);
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/Apache.Arrow.Adbc/Tracing/ActivityTrace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public void Dispose()
/// <summary>
/// If possible, gets the file version for the assembly associated with the given Type.
/// </summary>
[SuppressMessage("SingleFile", "IL3000", Justification="Using guard")]
[SuppressMessage("SingleFile", "IL3000", Justification = "Using guard")]
public static string GetAssemblyVersion(Type type)
{
var versionAttr = type.Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
Expand Down
2 changes: 1 addition & 1 deletion csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private string GetPathForAdbcH()
{
// find the adbc.h file from the repo

string path = Path.Combine(new string[] { "..", "..", "..", "..", "..", "c", "include", "arrow-adbc", "adbc.h"});
string path = Path.Combine(new string[] { "..", "..", "..", "..", "..", "c", "include", "arrow-adbc", "adbc.h" });

Assert.True(File.Exists(path));

Expand Down
4 changes: 2 additions & 2 deletions csharp/test/Apache.Arrow.Adbc.Tests/ClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static void CanClientExecuteUpdate(

int rows = adbcCommand.ExecuteNonQuery();

Assert.True(expectedResults[i]==rows, Utils.FormatMessage("Expected results are not equal", environmentName));
Assert.True(expectedResults[i] == rows, Utils.FormatMessage("Expected results are not equal", environmentName));
}
}

Expand Down Expand Up @@ -187,7 +187,7 @@ public static void VerifyTypesAndValues(
{
var column_schema = reader.GetColumnSchema();
DataTable? dataTable = reader.GetSchemaTable();
Assert.True(dataTable != null, Utils.FormatMessage("dataTable is null", environmentName) );
Assert.True(dataTable != null, Utils.FormatMessage("dataTable is null", environmentName));

Assert.True(reader.FieldCount == sample.ExpectedValues.Count, Utils.FormatMessage($"{sample.ExpectedValues.Count} fields were expected but {reader.FieldCount} fields were returned for the query [{sample.Query}]", environmentName));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ public class AdbcTable
/// <summary>
/// The constrains associated with the table.
/// </summary>
public List<AdbcConstraint>? Constraints { get; set; }
public List<AdbcConstraint>? Constraints { get; set; }
}
}
3 changes: 2 additions & 1 deletion csharp/test/Apache.Arrow.Adbc.Tests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,8 @@ protected string DelimitIdentifier(string value)

protected static void AssertContainsAll(string[] expectedTexts, string value)
{
if (expectedTexts == null) { return; };
if (expectedTexts == null) { return; }

foreach (string text in expectedTexts)
{
Assert.Contains(text, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Apache.Arrow.Adbc.Tests.Xunit
/// Used to specify the order of Xunit tests.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class OrderAttribute : Attribute
public class OrderAttribute : Attribute
{
public int Order { get; private set; }

Expand Down
2 changes: 1 addition & 1 deletion csharp/test/Drivers/Interop/FlightSql/FlightSqlData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private static SampleDataBuilder GetSpiceAISampleData()
StructBehavior = "Strict",
Query = "SELECT " +
"ARRAY[n_regionkey, n_nationkey] AS \"List\", " +
"struct(n_regionkey, 'Test Value') AS Struct "+
"struct(n_regionkey, 'Test Value') AS Struct " +
"FROM nation WHERE n_regionkey = 0 AND n_nationkey = 5",
ExpectedValues = new List<ColumnNetTypeArrowTypeValue>()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ out Dictionary<string, string> parameters
{
// see https://arrow.apache.org/adbc/main/driver/flight_sql.html

parameters = new Dictionary<string, string>{};
parameters = new Dictionary<string, string> { };

if(!string.IsNullOrEmpty(environment.Uri))
if (!string.IsNullOrEmpty(environment.Uri))
{
parameters.Add(FlightSqlParameters.Uri, environment.Uri!);
}

foreach(string key in environment.RPCCallHeaders.Keys)
foreach (string key in environment.RPCCallHeaders.Keys)
{
parameters.Add(FlightSqlParameters.OptionRPCCallHeaderPrefix + key, environment.RPCCallHeaders[key]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Apache.Arrow.Adbc.Telemetry.Traces.Exporters.FileExporter;
using OpenTelemetry;
using OpenTelemetry.Trace;
using Xunit;
using Xunit.Abstractions;
using Apache.Arrow.Adbc.Telemetry.Traces.Exporters.FileExporter;

namespace Apache.Arrow.Adbc.Tests.Telemetry.Traces.Exporters.FileExporter
{
Expand Down
Loading