Skip to content

fix: fixing double quote escape#360

Merged
rhajek merged 3 commits intomasterfrom
fix-escape-dsl
Jun 13, 2022
Merged

fix: fixing double quote escape#360
rhajek merged 3 commits intomasterfrom
fix-escape-dsl

Conversation

@rhajek
Copy link
Copy Markdown
Contributor

@rhajek rhajek commented Jun 9, 2022

Proposed Changes

This PR fixes the escaping of double quotes in flux-dsl.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • mvn test completes successfully
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@rhajek rhajek requested a review from bednar June 9, 2022 08:55
Copy link
Copy Markdown
Contributor

@bednar bednar left a 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:

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\"])");
}

@bednar bednar added the bug Something isn't working label Jun 9, 2022
@rhajek rhajek requested a review from bednar June 9, 2022 16:42
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 9, 2022

Codecov Report

Merging #360 (772c36f) into master (0e166e6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@            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           
Impacted Files Coverage Δ
.../dsl/functions/properties/FunctionsParameters.java 85.56% <100.00%> (+0.15%) ⬆️
...y/dsl/functions/restriction/ColumnRestriction.java 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e166e6...772c36f. Read the comment docs.

Copy link
Copy Markdown
Contributor

@bednar bednar left a comment

Choose a reason for hiding this comment

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

LGTM 🍺

@rhajek rhajek merged commit 0dcd249 into master Jun 13, 2022
@rhajek rhajek deleted the fix-escape-dsl branch June 13, 2022 06:54
@bednar bednar added this to the 6.1.1 milestone Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants