fix(csharp): improved TOML parsing#4340
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Improves the C# driver manager’s minimal TOML parser so it correctly handles driver-manifest TOML found in the ADBC documentation (notably single-quoted literal strings) and expands supported TOML constructs while remaining strict about unsupported productions.
Changes:
- Add support for TOML literal strings (
'...') and improve comment stripping to respect both basic and literal strings. - Add support for single-line arrays of supported scalar values (including trailing commas) and expand validation for malformed lines/keys.
- Expand and strengthen unit test coverage, including a spec-like driver manifest example.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| csharp/src/Apache.Arrow.Adbc/DriverManager/TomlParser.cs | Extends parser to support literal strings and arrays, adds key validation, and improves strict error handling/messages. |
| csharp/test/Apache.Arrow.Adbc.Tests/DriverManager/TomlParserTests.cs | Adds/updates tests for literal strings, arrays, malformed inputs, and a canonical manifest-style sample. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
davidhcoe
reviewed
May 20, 2026
The stricter key validation introduced earlier on this branch rejected dot-namespaced option keys like `adbc.snowflake.sql.warehouse`, which the connection-profile spec documents as the canonical form. The Rust (`rust/driver_manager/src/profile.rs`) and C++/Go (`go/adbc/drivermgr/adbc_driver_manager_profiles.cc`) driver managers reach the same flat-key dictionary by parsing dotted keys as nested tables and then flattening; this minimal parser accepts '.' as a bare- key character so it produces the same shape without implementing nesting. Quoted and whitespace-containing keys are still rejected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
davidhcoe
approved these changes
May 20, 2026
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.
Improved TOML parsing.
Closes #4328