Skip to content

Commit 1c28862

Browse files
committed
fix
1 parent bfc6cf5 commit 1c28862

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

src/Ydb.Sdk/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- ADO.NET: Added `BulkUpsertAsync` for batch upsert operations with transaction checks and integration tests.
1+
- ADO.NET: Added `BeginBulkUpsertImport` for batch upsert operations with transaction checks and integration tests.
22
- Optimization: On BadSession, do not invoke the `DeleteSession()` method.
33
- Canceling AttachStream after calling the `DeleteSession` method.
44
- Fixed bug: fixed issue where session was not deleted (`ClientTransportTimeout`).

src/Ydb.Sdk/src/Ado/BulkUpsert/BulkUpsertImporter.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public sealed class BulkUpsertImporter : IBulkUpsertImporter
1515
private readonly RepeatedField<Ydb.Value> _rows = new();
1616
private readonly CancellationToken _cancellationToken;
1717
private StructType? _structType;
18-
private int _currentBytes = 0;
18+
private int _currentBytes;
1919

2020
public BulkUpsertImporter(
2121
IDriver driver,
@@ -38,8 +38,7 @@ public async ValueTask AddRowAsync(object?[] values)
3838
throw new ArgumentException("Values count must match columns count", nameof(values));
3939

4040
var ydbValues = values.Select(v =>
41-
v as YdbValue ?? (v is YdbParameter param ? param.YdbValue :
42-
new YdbParameter { Value = v }.YdbValue)
41+
v as YdbValue ?? (v is YdbParameter param ? param.YdbValue : new YdbParameter { Value = v }.YdbValue)
4342
).ToArray();
4443

4544
var protoStruct = new Ydb.Value();
@@ -96,4 +95,4 @@ public async ValueTask FlushAsync(CancellationToken cancellationToken = default)
9695
_rows.Clear();
9796
_currentBytes = 0;
9897
}
99-
}
98+
}

src/Ydb.Sdk/src/Ado/BulkUpsert/IBulkUpsertImporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ public interface IBulkUpsertImporter
44
{
55
ValueTask AddRowAsync(object?[] rows);
66
ValueTask FlushAsync(CancellationToken cancellationToken = default);
7-
}
7+
}

src/Ydb.Sdk/test/Ydb.Sdk.Ado.Tests/YdbConnectionTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,6 @@ public async Task BulkUpsertImporter_ThrowsOnNonexistentTable()
489489

490490
await importer.AddRowAsync([YdbValue.MakeInt32(1), YdbValue.MakeUtf8("NotExists")]);
491491

492-
await Assert.ThrowsAsync<YdbException>(async () =>
493-
{
494-
await importer.FlushAsync();
495-
});
492+
await Assert.ThrowsAsync<YdbException>(async () => { await importer.FlushAsync(); });
496493
}
497494
}

0 commit comments

Comments
 (0)