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

Snapshot building for filter operations (part of roundtrip) #3737

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gs-gunjan
Copy link
Contributor

Summary

How did you test this change?

  • Test(s) added
  • Manual testing (please provide screenshots/recordings)
  • No testing (please provide an explanation)

Copy link

changeset-bot bot commented Dec 13, 2024

🦋 Changeset detected

Latest commit: e17a1b3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 28 packages
Name Type
@finos/legend-data-cube Patch
@finos/legend-application-data-cube Patch
@finos/legend-application-query Patch
@finos/legend-application-repl Patch
@finos/legend-query-builder Patch
@finos/legend-vscode-extension-dependencies Patch
@finos/legend-application-data-cube-bootstrap Patch
@finos/legend-application-query-bootstrap Patch
@finos/legend-extension-dsl-service Patch
@finos/legend-application-repl-deployment Patch
@finos/legend-application-studio Patch
@finos/legend-extension-dsl-data-quality Patch
@finos/legend-extension-dsl-data-space-studio Patch
@finos/legend-extension-dsl-data-space Patch
@finos/legend-application-data-cube-deployment Patch
@finos/legend-application-query-deployment Patch
@finos/legend-application-studio-bootstrap Patch
@finos/legend-extension-assortment Patch
@finos/legend-extension-dsl-diagram Patch
@finos/legend-extension-dsl-persistence Patch
@finos/legend-extension-dsl-text Patch
@finos/legend-extension-store-flat-data Patch
@finos/legend-extension-store-relational Patch
@finos/legend-extension-store-service-store Patch
@finos/legend-application-studio-deployment Patch
@finos/legend-application-pure-ide Patch
@finos/legend-application-pure-ide-deployment Patch
@finos/legend-server-showcase-deployment Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 77.69517% with 120 lines in your changes missing coverage. Please review.

Project coverage is 46.15%. Comparing base (5f31e37) to head (e17a1b3).

Files with missing lines Patch % Lines
...c/stores/core/DataCubeQuerySnapshotBuilderUtils.ts 73.55% 110 Missing ⚠️
...be/src/stores/core/DataCubeQuerySnapshotBuilder.ts 72.22% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3737      +/-   ##
==========================================
+ Coverage   44.88%   46.15%   +1.27%     
==========================================
  Files        2229     2229              
  Lines      385911   386183     +272     
  Branches    15874    16473     +599     
==========================================
+ Hits       173204   178262    +5058     
+ Misses     211943   207480    -4463     
+ Partials      764      441     -323     
Files with missing lines Coverage Δ
...d-data-cube/src/stores/core/DataCubeQueryEngine.ts 90.70% <100.00%> (+0.41%) ⬆️
...stores/core/filter/DataCubeQueryFilterOperation.ts 62.22% <ø> (+62.22%) ⬆️
...e/filter/DataCubeQueryFilterOperation__Contain.tsx 69.62% <ø> (+69.62%) ⬆️
...beQueryFilterOperation__ContainCaseInsensitive.tsx 65.88% <ø> (+65.88%) ⬆️
...e/filter/DataCubeQueryFilterOperation__EndWith.tsx 69.62% <ø> (+69.62%) ⬆️
...beQueryFilterOperation__EndWithCaseInsensitive.tsx 77.64% <ø> (+77.64%) ⬆️
...ore/filter/DataCubeQueryFilterOperation__Equal.tsx 82.53% <100.00%> (+82.53%) ⬆️
...CubeQueryFilterOperation__EqualCaseInsensitive.tsx 65.88% <ø> (+65.88%) ⬆️
...eryFilterOperation__EqualCaseInsensitiveColumn.tsx 62.65% <ø> (+62.65%) ⬆️
...lter/DataCubeQueryFilterOperation__EqualColumn.tsx 64.28% <ø> (+64.28%) ⬆️
... and 21 more

... and 304 files with indirect coverage changes

@gs-gunjan gs-gunjan marked this pull request as ready for review December 24, 2024 11:03
@gs-gunjan gs-gunjan requested a review from a team as a code owner December 24, 2024 11:03
@@ -234,6 +234,21 @@ export enum DataCubeQueryFilterOperator {
// TODO?: having, having in aggregate, between
}

export enum DataCubeEngineFilterOperator {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use DataCubeFunction

return undefined;
}

function _buildFilterConditionSnapshot(
Copy link
Contributor

Choose a reason for hiding this comment

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

as discussed, distribute this logic to each of the operator. For common logic that can be shared, we can leave them here, e.g. _not(), etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so this is the code for conditionExpression:
const filterCondition = filter;
const operation = filterOperations.find(
(op) => op.operator === filterCondition.operator,
);
const condition = operation?.buildConditionExpression(filterCondition);

operator for most cases is the same but different for some cases so will need switch case still to put in the operator  but I get the comment

throw new Error('Method not implemented.');
}

static filterOperations = [
Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove this. This inherits the list from DataCubeEngine.

[
_filter(
snapshot.data.filter!,
Test__DataCubeEngine.filterOperations,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Test__DataCubeEngine.filterOperations,
const engine = new Test__DataCubeEngine();
...
engine.filterOperations,

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.

2 participants