Fixed handling of DateTime64 columns#90
Open
MrDoe wants to merge 28 commits into
Open
Conversation
…, xunit, and NodaTime
* 'master' of https://github.com/MrDoe/ClickHouseClient: Update dotnet.yml Create dotnet.yml
…ameworks in project files
- Subproject-Commits in ClickSphere_API und ClickHouseClient geändert - Aktualisiere Paketreferenzen in ClickSphere_API.csproj: - `Microsoft.AspNetCore.OpenApi` auf `9.0.1` - `Microsoft.AspNetCore.Authentication.JwtBearer` auf `9.0.1` - `System.Configuration.ConfigurationManager` auf `9.0.1` - `TimeZoneConverter` auf `7.0.0` - `Swashbuckle.AspNetCore.Swagger` auf `7.2.0` - `Swashbuckle.AspNetCore.SwaggerGen` auf `7.2.0` - `Swashbuckle.AspNetCore.SwaggerUI` auf `7.2.0` - `OllamaSharp` auf `5.0.6` - Aktualisiere `NodaTime` in Octonica.ClickHouseClient.csproj auf `3.2.1`
…ecks in WriteBatсhes method
There was a problem hiding this comment.
Pull request overview
This PR refactors code style across multiple files in the ClickHouse client library, converting traditional if-else statements and multi-line expressions to more concise expression-bodied members, ternary operators, and switch expressions. The changes also include minor improvements such as target-typed new expressions, collection expressions, range operators, and updated import ordering to follow standard conventions (System namespaces before project namespaces).
Changes:
- Converted traditional control flow statements to expression-bodied members and ternary operators
- Replaced multi-line if-else chains with switch expressions and pattern matching
- Applied modern C# syntax features (target-typed
new, collection expressions, range operators) - Reordered using statements to follow conventions (System namespaces first)
Reviewed changes
Copilot reviewed 162 out of 186 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| FunctionHelper.cs | Expanded lambda expressions to use explicit return statements |
| ConstantReadOnlyList.cs | Converted methods to use ternary operators and added braces |
| CommonUtils.cs | Added braces to single-line if statements and simplified assignments |
| CertificateHelper.cs | Updated to use collection expressions and target-typed new |
| CertificateHelper.Net5.0.cs | Added internal access modifier |
| VariantTypeInfo.cs | Converted if-else chains to ternary operators throughout |
| VariantTableColumn.cs | Simplified GetValue method with ternary operator |
| UuidTypeInfo.cs | Converted methods to use ternary operators and updated imports |
| UInt8TypeInfo.cs | Simplified column writer creation with ternary operators |
| Multiple TableColumn files | Converted TryReinterpret methods to use ternary operators |
| Multiple TypeInfo files | Converted parameter writers to use ternary operators and updated imports |
| NullableTypeInfo.cs | Extensive conversion to ternary operators and switch expressions |
| LowCardinalityTypeInfo.cs | Converted methods to ternary operators and switch expressions |
| IClickHouseColumnTypeInfo.cs | Converted methods to switch expressions |
| IClickHouseColumnTypeDescriptor.cs | Changed TimeZone property type from TimeZoneInfo to DateTimeZone |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I fixed two major problems concerning the handling of DateTime64 data:
I couldn't get this to work correctly with standard .NET functions, so I integrated the NodaTime library for this.
The problem is, that the Windows timezone database does not have historical data, only data enough to cover more recent times. So the timezones with DST have no dynamic adjustment rules before 1970-01-01. NodaTime however does include the necessary historic data to do the DST calculations right.
See NodaTime Blog for a more deeper explanation.
Note: