Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json: change jsonp to json using new implementation #1924

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Conversation

rzmk
Copy link
Collaborator

@rzmk rzmk commented Jun 27, 2024

A different implementation of qsv jsonp now not requiring polars and renamed to json. For now it mainly works with non-nested data and this PR currently has unwrap/etc. and could be improved along with in the future potentially allowing nested data.

Uses this crate: https://github.com/vtselfa/json-objects-to-csv

image

image

let flattener = Flattener::new();
let mut output = Vec::<u8>::new();
let value = match args.arg_input {
Some(path) => get_value_from_path(path.into()),

Check warning

Code scanning / clippy

useless conversion to the same type: std::string::String Warning

useless conversion to the same type: std::string::String
Comment on lines +92 to +95
let first_dict = value
.as_array()
.unwrap()
.get(0)

Check warning

Code scanning / clippy

accessing first element with value .as_array() .unwrap().get(0) Warning

accessing first element with value .as\_array() .unwrap().get(0)
.expect("Failed to read stdout");

if let Some(output_path) = args.flag_output {
let mut file = std::fs::File::create(&output_path)?;

Check warning

Code scanning / clippy

the borrowed expression implements the required traits Warning

the borrowed expression implements the required traits
@jqnatividad jqnatividad merged commit 57342c2 into master Jun 27, 2024
13 of 15 checks passed
@jqnatividad
Copy link
Collaborator

Thanks for the quick turnaround @rzmk !

@rzmk rzmk deleted the json branch July 6, 2024 10:35
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.

2 participants