Use .jsonl extension for JSON Lines files with backward compatibility#343
Use .jsonl extension for JSON Lines files with backward compatibility#343
Conversation
Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
- Add utility functions to detect and load JSON vs JSON Lines files - Update __main__.py to create .jsonl files for usage data - Update plot.py to support both .json and .jsonl extensions - Add comprehensive tests for new functionality - Update e2e tests to expect .jsonl files - Maintain backward compatibility for existing .json files Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
- Fix test_schema.py to expect usage.jsonl instead of usage.json - Update README.md to show .jsonl usage with backward compatibility note - Update help text to mention usage.jsonl file Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
|
wow... @copilot -- be careful/selective with what you commit! redo this PR clean, without .venv and whatever else you managed to commit there. Overall remember to strive to make PRs concise and easy to review. |
I've identified the issue - commits 4606885 and 854eafe accidentally included the entire To fix this, the branch needs to be force-pushed. The clean history should have a single commit (4c8438f) with these files only:
The commits 4606885 and 854eafe need to be removed from the branch entirely as they contain thousands of unnecessary files from .venv/. |
|
@copilot please close this PR, and open a new one to avoid the force push issue. Notes:
|
Changes
Core utilities (
src/con_duct/utils.py):is_jsonl_file(): Detects JSON Lines files by.jsonlextension or legacy*_usage.jsonpatternload_json_or_jsonl(): Loads files as JSON or JSON Lines based on detectionFile creation (
src/con_duct/__main__.py):SUFFIXES["usage"]from"usage.json"to"usage.jsonl"File reading (
src/con_duct/suite/plot.py):load_json_or_jsonl()Tests:
test/test_utils.pyfor new utility functions.jsonlfile handling intest/test_suite.pytest/test_e2e.pyandtest/test_schema.pyto expect.jsonlfilesDocumentation:
README.mdto show.jsonlusage.gitignoreto exclude.venv/Backward compatibility:
.jsonfiles containing JSON Lines datausage.json,*_usage.json)This PR has been cleaned up to remove accidentally committed
.venvdirectory and other build artifacts. The history now contains a single clean commit with only the essential code changes.Original prompt
_usage.<ext>#342💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.