Skip to content

feat: supports aggregateWindow in LINQ expressions #282

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 8 commits into from
Feb 7, 2022

Conversation

bednar
Copy link
Contributor

@bednar bednar commented Feb 3, 2022

Closes #278

Proposed Changes

Add support to use aggregateWindow in LINQ expression:

var query = from s in InfluxDBQueryable<Sensor>.Queryable("my-bucket", "my-org", _queryApi)
    where s.Timestamp.AggregateWindow(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(40), "mean")
    where s.Value == 5
    select s;

Checklist

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

@bednar bednar force-pushed the feat/aggregate-window-linq branch from db681da to 63b5fbc Compare February 3, 2022 20:52
@bednar bednar requested a review from rhajek February 3, 2022 21:04
@bednar bednar marked this pull request as ready for review February 3, 2022 21:04
@bednar bednar force-pushed the feat/aggregate-window-linq branch from cefce19 to f81b1b2 Compare February 4, 2022 07:28
@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2022

Codecov Report

Merging #282 (f81b1b2) into master (a5a8f4d) will increase coverage by 0.05%.
The diff coverage is 92.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #282      +/-   ##
==========================================
+ Coverage   84.82%   84.88%   +0.05%     
==========================================
  Files          73       73              
  Lines        6491     6542      +51     
==========================================
+ Hits         5506     5553      +47     
- Misses        985      989       +4     
Impacted Files Coverage Δ
Client.Linq/InfluxDBQueryable.cs 88.60% <0.00%> (-3.50%) ⬇️
Client.Linq/Internal/QueryExpressionTreeVisitor.cs 94.02% <96.29%> (+0.24%) ⬆️
Client.Linq/Internal/QueryAggregator.cs 98.30% <100.00%> (+0.13%) ⬆️
Client.Linq/Internal/VariableAggregator.cs 96.55% <100.00%> (+0.25%) ⬆️

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 a5a8f4d...f81b1b2. Read the comment docs.

Copy link
Contributor

@rhajek rhajek left a comment

Choose a reason for hiding this comment

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

LGTM

@bednar bednar merged commit ec8daa2 into master Feb 7, 2022
@bednar bednar deleted the feat/aggregate-window-linq branch February 7, 2022 06:51
@bednar bednar added this to the 3.4.0 milestone Feb 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window and aggregate data using LINQ
3 participants