Skip to content

fix(csharp): improved TOML parsing#4340

Merged
CurtHagenlocher merged 3 commits into
apache:mainfrom
CurtHagenlocher:FixToml
May 20, 2026
Merged

fix(csharp): improved TOML parsing#4340
CurtHagenlocher merged 3 commits into
apache:mainfrom
CurtHagenlocher:FixToml

Conversation

@CurtHagenlocher
Copy link
Copy Markdown
Contributor

Improved TOML parsing.

Closes #4328

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread csharp/src/Apache.Arrow.Adbc/DriverManager/TomlParser.cs Outdated
Comment thread csharp/src/Apache.Arrow.Adbc/DriverManager/TomlParser.cs
Comment thread csharp/src/Apache.Arrow.Adbc/DriverManager/TomlParser.cs
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>
@CurtHagenlocher CurtHagenlocher merged commit e471d53 into apache:main May 20, 2026
13 checks passed
@CurtHagenlocher CurtHagenlocher deleted the FixToml branch May 21, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

csharp: literal strings not supported by driver manager toml parser

3 participants