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

Added variable substitution to FacetsFilter #4061

Merged
merged 8 commits into from
Oct 9, 2019

Conversation

harshil-goel
Copy link
Contributor

@harshil-goel harshil-goel commented Sep 25, 2019

Fixes #2481


This change is Reviewable

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

✅ A review job has been created and sent to the PullRequest network.


@harshil-goel you can click here to see the review status or cancel the code review job.

Copy link
Contributor

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain and @pawanrawal)

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

I have left an inline comment regarding the backtick in one of the test. Please compare the commented version to the correct one to see the difference.


Reviewed with ❤️ by PullRequest

gql/parser_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pawanrawal pawanrawal left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 3 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @harshil-goel and @manishrjain)


gql/parser_test.go, line 2040 at r2 (raw file):

  q(func: has(works_in)) @cascade {
    name
    works_in @facets @facets(gt(since, $since)) {

And a couple of other filters as well here, taking in different values and see they are substituted as well.


query/query_facets_test.go, line 82 at r2 (raw file):

func TestFacetWithVar(t *testing.T) {
	triples := `
_:f <name> "user1" .

Do all this in a common place in populateClusterWithFacets please. Actually do you really need to have a new dataset for this? Can't you mint out a query with the existing data set?

Copy link
Contributor

@pawanrawal pawanrawal left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @harshil-goel and @manishrjain)


gql/parser_test.go, line 2040 at r2 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

And a couple of other filters as well here, taking in different values and see they are substituted as well.

Please address this comment and then this PR is good to go.


query/query_facets_test.go, line 80 at r3 (raw file):

}

func TestFacetWithVarLE(t *testing.T) {

Le


query/query_facets_test.go, line 101 at r3 (raw file):

}

func TestFacetWithVarGT(t *testing.T) {

Gt

gql/parser_test.go Show resolved Hide resolved
Copy link
Contributor Author

@harshil-goel harshil-goel left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 3 files reviewed, 6 unresolved discussions (waiting on @balajijinnah, @manishrjain, @pawanrawal, and @pullrequest[bot])


gql/parser_test.go, line 2045 at r1 (raw file):

Previously, pullrequest[bot] wrote…

This backtick seems to be misplaced. Please move it to leftmost edge.

Done.


gql/parser_test.go, line 2040 at r2 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Please address this comment and then this PR is good to go.

Done.


query/query_facets_test.go, line 82 at r2 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Do all this in a common place in populateClusterWithFacets please. Actually do you really need to have a new dataset for this? Can't you mint out a query with the existing data set?

Done.


query/query_facets_test.go, line 80 at r3 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Le

Done.


query/query_facets_test.go, line 101 at r3 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Gt

Done.

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm: Add some docs somewhere which says that we support var substitution in facets now.

Reviewed 1 of 3 files at r1, 1 of 1 files at r2, 1 of 1 files at r4.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @balajijinnah, @pawanrawal, and @pullrequest[bot])

@harshil-goel harshil-goel merged commit 7e74f43 into master Oct 9, 2019
@harshil-goel harshil-goel deleted the harshil-goel/query-with-var branch October 9, 2019 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

QueryWithVars on facet filtering fails silently
5 participants