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

service: add csv.delim query param to load API #4333

Merged
merged 2 commits into from
Jan 26, 2023
Merged

service: add csv.delim query param to load API #4333

merged 2 commits into from
Jan 26, 2023

Conversation

nwt
Copy link
Member

@nwt nwt commented Jan 25, 2023

The csv.delim query parameter to the load API (POST /pool/{pool}/branch/{branch}) specifies the field delimiter for CSV input, allowing use of a character other than ",".

For #4238.

The csv.delim query parameter to the load API (POST
/pool/{pool}/branch/{branch}) specifies the field delimiter for CSV
input, allowing use of a character other than ",".

For #4238.
@nwt nwt requested a review from a team January 25, 2023 15:58
@nwt nwt linked an issue Jan 25, 2023 that may be closed by this pull request
@philrz
Copy link
Contributor

philrz commented Jan 25, 2023

I just did a test on this branch at commit c085b95 with the same test data I used here to verify this worked with the CLI tooling, and it worked fine. Note that with this particular example of a semicolon I had to URL escape it.

$ wget "https://dgsaie.mise.gov.it/open_data_export.php?export-id=1&export-type=csvx"

$ curl http://localhost:9867/version
{"version":"v1.4.0-28-gc085b95a"}

$ zed create fuel
pool created: fuel 2KpLikYLBASDFXIinJO4dRD3TIg

$ curl -H "Content-Type: text/csv" --data-binary @open_data_export.php\?export-id\=1\&export-type\=csvx http://localhost:9867/pool/fuel/branch/main?csv.delim=%3B
{commit:0x105f14f2d02a46a39de465768fcc719c634db18f(=ksuid.KSUID),warnings:[]([string])}(=api.CommitResponse)

$ zed query -Z 'from fuel | head 1'
{
    "DATA_RILEVAZIONE": "2023-01-23",
    BENZINA: "1.829,47",
    GASOLIO_AUTO: "1.875,1",
    GPL: "797,85",
    GASOLIO_RISCALDAMENTO: "1.674,7",
    "O.C._FLUIDO_BTZ": "1.129,73",
    "O.C._DENSO_BTZ": "645,22"
}

So that's a functional 👍 for me!

@nwt nwt merged commit 21e80a3 into main Jan 26, 2023
@nwt nwt deleted the service-csv.delim branch January 26, 2023 21:02
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.

Allow non-comma separator for CSV input
3 participants