-
Notifications
You must be signed in to change notification settings - Fork 0
Fspes 140 #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fspes 140 #76
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,11 +15,12 @@ public class Options | |||||||
| public int CommandTimeoutSeconds { get; set; } | ||||||||
|
|
||||||||
| /// <summary> | ||||||||
| /// Defines the number of rows to be processed before generating a notification event. | ||||||||
| /// Defines the number of rows to be processed before generating a notification event. | ||||||||
| /// The default value of 0 will set NotifyAfter dynamically to 10% of the total row count, with a minimum value of 1. | ||||||||
| /// A value of -1 means there won't be any notifications until the task is completed, and Result.Count will be 0. | ||||||||
| /// Setting a value greater than the total number of rows can cause Result.Count to be 0. | ||||||||
| /// A value of -1 means there won't be any notifications until the task is completed. | ||||||||
| /// Setting a value greater than the total number of rows can cause notification response to be 0. | ||||||||
| /// Notification events can be used for error handling to see approximately which row the error occurred at. | ||||||||
| /// Notified value is useful for error handling and show approximately which row the error occured at | ||||||||
|
Comment on lines
22
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix duplicated/typoed The second sentence repeats the same idea and contains a typo ( Suggested doc cleanup- /// Notification events can be used for error handling to see approximately which row the error occurred at.
- /// Notified value is useful for error handling and show approximately which row the error occured at
+ /// Notification events can be used for error handling to show approximately which row the error occurred at.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MatteoDelOmbra check suggested fix from coderabbit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||
| /// </summary> | ||||||||
| /// <example>0</example> | ||||||||
| public int NotifyAfter { get; set; } | ||||||||
|
|
@@ -46,7 +47,7 @@ public class Options | |||||||
| public bool TableLock { get; set; } | ||||||||
|
|
||||||||
| /// <summary> | ||||||||
| /// Preserve null values in the destination table regardless of the settings for default values. | ||||||||
| /// Preserve null values in the destination table regardless of the settings for default values. | ||||||||
| /// When not specified, null values are replaced by default values where applicable. | ||||||||
| /// </summary> | ||||||||
| /// <example>false</example> | ||||||||
|
|
@@ -82,4 +83,4 @@ public class Options | |||||||
| /// <example>SqlTransactionIsolationLevel.ReadCommitted</example> | ||||||||
| [DefaultValue(SqlTransactionIsolationLevel.ReadCommitted)] | ||||||||
| public SqlTransactionIsolationLevel SqlTransactionIsolationLevel { get; set; } | ||||||||
| } | ||||||||
| } | ||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SetEmptyDataRowsToNullcan write to the wrong column when values repeat.Using
Array.IndexOf(row.ItemArray, column)inside value iteration resolves the first matching index, so duplicate empty values in the same row can leave later columns unchanged.Suggested fix (index-based iteration)
private static void SetEmptyDataRowsToNull(DataSet dataSet) { foreach (var table in dataSet.Tables.Cast<DataTable>()) foreach (var row in table.Rows.Cast<DataRow>()) - foreach (var column in row.ItemArray) - if (column.ToString() == string.Empty) - { - var index = Array.IndexOf(row.ItemArray, column); - row[index] = null; - } + { + for (var i = 0; i < row.ItemArray.Length; i++) + { + if (row[i] is string value && value.Length == 0) + row[i] = DBNull.Value; + } + } }🧰 Tools
🪛 GitHub Actions: BulkInsert build test / 0_build _ Build on ubuntu-22.04.txt
[error] 190-190: dotnet format reported WHITESPACE issues. Fix whitespace formatting by inserting '\s\s\s\s'.
[error] 191-191: dotnet format reported WHITESPACE issues. Fix whitespace formatting by inserting '\s\s\s\s\s\s\s\s'.
[error] 192-192: dotnet format reported WHITESPACE issues. Fix whitespace formatting by inserting '\s\s\s\s\s\s\s\s'.
[error] 193-193: dotnet format reported WHITESPACE issues. Fix whitespace formatting by inserting '\s\s\s\s\s\s\s\s'.
[error] 194-194: dotnet format reported WHITESPACE issues. Fix whitespace formatting by inserting '\s\s\s\s\s\s\s\s'.
[error] 195-195: dotnet format reported WHITESPACE issues. Fix whitespace formatting by inserting '\s\s\s\s\s\s\s\s'.
[error] 196-196: dotnet format reported WHITESPACE issues. Fix whitespace formatting by inserting '\s\s\s\s\s\s\s\s'.
🪛 GitHub Actions: BulkInsert build test / build _ Build on ubuntu-22.04
[error] 190-190: dotnet format (WHITESPACE) failed. Fix whitespace formatting. Insert '\s\s\s\s'.
[error] 191-191: dotnet format (WHITESPACE) failed. Fix whitespace formatting. Insert '\s\s\s\s\s\s\s\s'.
[error] 192-192: dotnet format (WHITESPACE) failed. Fix whitespace formatting. Insert '\s\s\s\s\s\s\s\s'.
[error] 193-193: dotnet format (WHITESPACE) failed. Fix whitespace formatting. Insert '\s\s\s\s\s\s\s\s'.
[error] 194-194: dotnet format (WHITESPACE) failed. Fix whitespace formatting. Insert '\s\s\s\s\s\s\s\s'.
[error] 195-195: dotnet format (WHITESPACE) failed. Fix whitespace formatting. Insert '\s\s\s\s\s\s\s\s'.
[error] 196-196: dotnet format (WHITESPACE) failed. Fix whitespace formatting. Insert '\s\s\s\s\s\s\s\s'.
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MatteoDelOmbra This one is not related to your fix, but worth checking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.