-
Notifications
You must be signed in to change notification settings - Fork 130
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
fix: fixing double quote escape #360
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.
Thanks for your PR 👍
Please, fix the escaping at all places:
Line 168 in 0942b39
public String toString() { Line 72 in 86bda85
public static String serializeValue(@Nonnull final Object value) {
Try the following test:
@Test
void escaping() {
Restrictions restrictions = Restrictions.tag("_value").contains(new String[]{"val\"ue1", "value2"});
Assertions.assertThat(restrictions.toString()).isEqualTo("contains(value: r[\"_value\"], set:[\"val\\\"ue1\", \"value2\"])");
Flux flux = Flux
.from("telegraf")
.drop(new String[]{"host", "ta\"g"});
Assertions.assertThat(flux.toString())
.isEqualToIgnoringWhitespace("from(bucket:\"telegraf\") |> drop(columns:[\"host\", \"ta\\\"g\"])");
}
flux-dsl/src/main/java/com/influxdb/query/dsl/functions/restriction/ColumnRestriction.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #360 +/- ##
=========================================
Coverage 88.98% 88.99%
- Complexity 634 636 +2
=========================================
Files 155 155
Lines 6339 6341 +2
Branches 302 302
=========================================
+ Hits 5641 5643 +2
Misses 612 612
Partials 86 86
Continue to review full report at Codecov.
|
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 🍺
Proposed Changes
This PR fixes the escaping of double quotes in flux-dsl.
Checklist
mvn test
completes successfully