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

fix(core): repair nesting of flux expressions #252

Merged
merged 5 commits into from
Sep 9, 2020
Merged

Conversation

sranka
Copy link
Contributor

@sranka sranka commented Sep 9, 2020

Fixes #251

This PR fixes the flux template function so that

  • a non-interpolated (simple) string returns a flux expression
  • an empty flux expression can be wrapped into another flux expression

It also improves and repairs the tests of the flux template function, some of them were not executed due to incorrect usage of mocha.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • yarn test completes successfully
  • Commit messages are in semantic format

@sranka sranka marked this pull request as ready for review September 9, 2020 06:30
@sranka sranka requested a review from vlastahajek September 9, 2020 06:30
@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2020

Codecov Report

Merging #252 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #252   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           28        28           
  Lines          963       966    +3     
  Branches       210       212    +2     
=========================================
+ Hits           963       966    +3     
Impacted Files Coverage Δ
packages/core/src/query/flux.ts 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 ec924c6...c0e7b53. Read the comment docs.

@backbone87
Copy link
Contributor

lgtm,

have you checked the empty expression error?

const inner = last ? flux`|> last()` : flux``;
const outer = flux`from(bucket: "a") ${last} |> yield()`;

@sranka sranka force-pushed the 251/flux_expression branch from 488b82f to 4de106c Compare September 9, 2020 07:49
@sranka sranka merged commit 299d33e into master Sep 9, 2020
@sranka sranka deleted the 251/flux_expression branch September 9, 2020 16:42
@bednar bednar added this to the 1.7.0 milestone Sep 16, 2020
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

Successfully merging this pull request may close these issues.

Nested flux templates produce unexpected results
5 participants