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

[q3KTZ83O] Remove strange clean up method #517

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

gem-neo4j
Copy link
Contributor

@gem-neo4j gem-neo4j commented Oct 26, 2023

Allow double quotes in node and rel properties with export csv.

Automatic is quote: always, so now using bulkImport everything is super quoted, but it matches how not using bulkImport works :)

@gem-neo4j gem-neo4j force-pushed the dev_fix_double_quoting_issues_export_csv branch from 026e9aa to 06bccbf Compare October 27, 2023 07:14
@gem-neo4j gem-neo4j marked this pull request as ready for review October 27, 2023 08:30
@@ -196,7 +196,7 @@ private void writeNodesBulkImport(Reporter reporter, ExportConfig config, Export
return joinLabels(entrySet.getKey(), config.getArrayDelim());
}
String prop = s.split(":")[0];
return "".equals(prop) ? String.valueOf(getNodeId(tx, n.getElementId())) : cleanPoint(FormatUtils.toString(n.getProperty(prop, "")));
return prop.isEmpty() ? String.valueOf(getNodeId(tx, n.getElementId())) : FormatUtils.toString(n.getProperty(prop, ""));
Copy link
Contributor

@loveleif loveleif Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the condition prop.isEmpty() can never be false?

scala> val prop = "".split(":")
val prop: Array[String] = Array("")

scala> prop.isEmpty
val res1: Boolean = false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry, I didn't see the [0] part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But prop is not a list, it is a string because it takes the first element:

String prop = s.split(":")[0]; // Note the [0]

Comment on lines -236 to -241
private String cleanPoint(String point) {
point = point.replace(",\"z\":null", "");
point = point.replace(",\"heigth\":null", "");
point = point.replace("\"", "");
return point;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤮

@loveleif loveleif self-assigned this Oct 27, 2023
Copy link
Contributor

@loveleif loveleif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@gem-neo4j gem-neo4j merged commit 388d5cf into dev Oct 27, 2023
15 checks passed
@gem-neo4j gem-neo4j deleted the dev_fix_double_quoting_issues_export_csv branch October 27, 2023 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants