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
[#965] Escape delimiters in csv strings #1005
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in most parts.
@@ -72,7 +92,7 @@ public void testWriteWithDifferentPropertyTypes() throws Exception { | |||
* Test CSVDataSink to properly separate the metadata | |||
* of edges and vertices using the same label. | |||
* | |||
* @throws Exception | |||
* @throws Exception on failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be more specific.
/** | ||
* Test CSVDataSink to properly escape strings and labels. | ||
* | ||
* @throws Exception on failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be more specific.
/** | ||
* Test CSVDataSink using existing a metadata.csv | ||
* | ||
* @throws Exception on failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be more specific.
* Test IndexedCSVDataSink to properly escape strings and labels. The graph is created manually, | ||
* since GDL does not support special characters. | ||
* | ||
* @throws Exception on failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be more specific.
} | ||
|
||
/** | ||
* Test writing and reading a graph with an existing metadata file. | ||
* | ||
* @throws Exception on failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a specific exception msg.
In my opinion, it is a bit over-engineered. Please have a look at the `StringEscapeUtils" class from the apache commons package. They are escaping strings in csv files with quotes, if there is a char inside that has to be escaped. It think, searching for chars with loops in the strings is not a good choice. In my opinion it is too much logic for exceptional cases, which would actually have to be done in a data-cleaning step. |
fixes #965