Add structuretocsv for JSON Structure to CSV conversion - #82
Conversation
Additional RequirementsDocumentationThe README.md file needs to be updated to include documentation for this new conversion feature, following the pattern established for existing conversions. TestingAll tests must follow the established testing patterns:
This follows the pattern established for the Avro conversion tests in the repository. |
|
@copilot Please retry the implementation. The previous run exceeded token usage limits. |
|
@copilot Please retry the implementation. The previous run exceeded token usage limits. |
Implementation completed successfully in commit 499782c. Changes made:
Test Coverage:
All tests follow the established pattern for schema conversions. |
|
@copilot rebase |
|
@copilot The branch has merge conflicts with master, primarily in avrotize/commands.json and README.md. Please resolve these conflicts by rebasing onto the latest master branch and updating the conflicting sections appropriately. |
Rebase completed successfully in commit 7c27df3. Changes made:
The branch now has a clean history with all changes properly integrated with the latest master branch. Note: The rebased branch requires force-push to update the remote. The local branch is ready at commit 7c27df3. |
Rebase completed successfully in commit 58f7968. Changes made:
The branch now has a clean history with all changes properly integrated with the latest master. The rebased branch requires force-push to update the remote. |
- Implemented StructureToCSVConverter class in avrotize/structuretocsv.py - Added s2csv command to CLI (commands.json) - Created comprehensive test suite (test_structuretocsv.py) - Supports all JSON Structure Core types and features: * Primitive types (string, number, boolean, int8-128, uint8-128, float/double, decimal, etc.) * Extended types (binary, date, time, datetime, duration, uuid, uri, jsonpointer) * Compound types (object, array, set, map, tuple, choice) * Validation constraints (maxLength, minLength, pattern, minimum, maximum, precision, scale) * Enum and const keywords * Required/optional properties * Schema references ($ref) * Namespaces and definitions All tests passing (7/7) Co-authored-by: clemensv <542030+clemensv@users.noreply.github.com>
Co-authored-by: clemensv <542030+clemensv@users.noreply.github.com>
…ation - Fixed bug handling union types (type as list) in converter - Updated tests to follow proper pattern: compare with reference files in test/struct - Generated all 10 CSV reference files for test schemas - Updated README.md with s2csv command documentation - All 10 tests now passing with reference comparisons Co-authored-by: clemensv <542030+clemensv@users.noreply.github.com>
499782c to
2d2afe1
Compare
Plan: Implement structuretocsv - JSON Structure to CSV Schema Conversion
This PR implements conversion from JSON Structure schemas to CSV Schema following the patterns established by existing converters.
Implementation Checklist
Core Module: Create
avrotize/structuretocsv.pyStructureToCSVConverterclass followingavrotocsv.pypatternsCLI Integration: Update
avrotize/commands.jsons2csvcommand definition with appropriate argsTests: Create
test/test_structuretocsv.pyDocumentation: Update relevant docs
Rebase: Rebased onto latest master (a69ab22)
Key Features Implemented
✅ Full JSON Structure Core Support:
✅ JSON Structure Features:
✅ Type Mappings (JSON Structure → CSV Schema):
✅ Tests: 10 comprehensive tests following proper patterns:
All tests compare generated output with reference files in test/struct directory, following the established pattern for schema conversions.
CLI Usage
Documentation
Full documentation added to README.md including:
Reference Files
/home/runner/work/avrotize/avrotize/avrotize/avrotocsv.py- Output pattern/home/runner/work/avrotize/avrotize/avrotize/structuretocsharp.py- JSON Structure handling/home/runner/work/avrotize/avrotize/avrotize/structuretopython.py- JSON Structure handlingFixes Add structuretocsv: JSON Structure to CSV Schema conversion #38
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.