feat: keep track of line numbers when making exceptions#16
Conversation
WalkthroughThis pull request makes adjustments to tests and core file reader/writer modules. In the tests, newline characters have been removed from header and data rows, and the expected error message is updated to include the line number. In the reader module, a new Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as "Data Reader Caller"
participant Reader as "DelimitedDataReader"
participant Filter as "_filter_out_comments"
participant Decoder as "JSONDecoder"
participant Converter as "convert"
Caller->>Reader: Initiate data reading
Reader->>Filter: Process input lines (increment _line_count)
Filter-->>Reader: Return filtered lines
Reader->>Decoder: Decode data record
alt Successful decode
Decoder-->>Reader: Decoded record
Reader->>Converter: Convert record with str_keys=True
Converter-->>Reader: Converted record
Reader-->>Caller: Yield processed record
else Decode error occurs
Decoder-->>Reader: Return error
Reader-->>Caller: Raise error detailing current _line_count
end
Possibly related PRs
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🪛 GitHub Check: unit-tests (3.11)typeline/_writer.py[warning] 48-48: 🪛 GitHub Check: unit-tests (3.12)typeline/_writer.py[warning] 48-48: 🪛 GitHub Check: unit-tests (3.10)typeline/_writer.py[warning] 48-48: 🪛 GitHub Check: unit-tests (3.13)typeline/_writer.py[warning] 48-48: 🔇 Additional comments (16)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Closes #12
Summary by CodeRabbit