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

|-handling #124

Open
marcelklehr opened this issue Mar 20, 2022 · 7 comments
Open

|-handling #124

marcelklehr opened this issue Mar 20, 2022 · 7 comments

Comments

@marcelklehr
Copy link
Member

No description provided.

@marcelklehr
Copy link
Member Author

@michael-franke I believe neither magpie-base nor magpie-backend currently have code that handles submissions containing |-chars in items of |-delimited lists.

@michael-franke
Copy link
Member

michael-franke commented Apr 20, 2022 via email

@x-ji
Copy link
Member

x-ji commented Apr 20, 2022

FYI, on the backend what currently happens is that a JSON array will be printed in the output CSV with "|" as the separator. I guess it will indeed be some processing on the frontend at submission time that figures out if the response is supposed to be submitted as an array.

@marcelklehr
Copy link
Member Author

marcelklehr commented Apr 20, 2022

I remember discussing some rule like this: if N is the maximum number of “|” occurring in direct sequence (e.g., “||||” -> N=4) in the input to be demarcated with “|”, then use N+1 bars (“|||||”) as demarcator. That’s hideous in worst-case scenarios, but should work alright in practice.

should this then be used on the whole dataset or only in the specific rows where the | occurs?

@michael-franke
Copy link
Member

michael-franke commented Apr 20, 2022 via email

@marcelklehr
Copy link
Member Author

Only where we insert | due to array conversion.

Usually array conversion will have to happen in every row though, right?

e.g. for this dataset...

a,b
['a text', 'another text'], 3
['a text with |-chars', 'another text'], 4

do we output...

a,b
a text|another text, 3
a text with |-chars||another text, 4

...or...

a,b
a text||another text, 3
a text with |-chars||another text, 4

@michael-franke
Copy link
Member

michael-franke commented Oct 11, 2022 via email

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

No branches or pull requests

3 participants