Support multiline directives in connection file parser#11
Merged
Conversation
Add support for the `>` block syntax in the connection parser, enabling multiline values like KAFKA_SSL_CA_PEM with PEM certificates. - Switch connection parser from for-each to index-based while loop - Use read_directive_block() for KAFKA_SSL_CA_PEM > blocks - Update generator to emit block syntax for multiline values - Add tests for multiline parsing and generation Closes #10 Amp-Thread-ID: https://ampcode.com/threads/T-019d1a2d-e5a7-77fb-b97e-e855f84a34a4 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d1a2d-e5a7-77fb-b97e-e855f84a34a4 Co-authored-by: Amp <amp@ampcode.com>
rmorehig
approved these changes
Mar 23, 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.
Summary
Adds support for multiline directives in the connection file parser, specifically for
KAFKA_SSL_CA_PEMwith PEM certificates.Changes
Parser (
parse_connection.py):forloop to index-basedwhileloopCONNECTION_DIRECTIVESset and_is_connection_directive_line()predicateKAFKA_SSL_CA_PEM >is encountered, usesread_directive_block()to collect indented continuation linesKAFKA_SSL_CA_PEMvalues continue to work as beforeGenerator (
connection.py):>block syntax with 4-space indentation whenssl_ca_pemcontains newlinesTests: 5 new tests covering:
Context
Follows the same approach as the TS SDK: tinybirdco/tinybird-sdk-typescript#129
Closes #10