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

An error was being returned when an empty response is expected. #2611

Merged

Conversation

srfrog
Copy link
Contributor

@srfrog srfrog commented Sep 25, 2018

When testing inequality value vars with non-matching values, the
response was sent as an error although it should return empty result
if the query has correct syntax.

Closes #2610


This change is Reviewable

When testing inequality value vars with non-matching values, the
response was sent as an error although it should return empty result
if the query has correct syntax.

Closes #2610
query/query.go Outdated
@@ -1634,7 +1634,8 @@ func (sg *SubGraph) replaceVarInFunc() error {

func (sg *SubGraph) ApplyIneqFunc() error {
if sg.Params.uidToVal == nil {
return x.Errorf("Expected a valid value map. But got empty.")
x.Println("Expected a valid value map. But got empty.")
Copy link
Contributor

Choose a reason for hiding this comment

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

You can get rid of the println here. Just return nil

@manishrjain
Copy link
Contributor

LGTM. One comment.

Copy link
Contributor Author

@srfrog srfrog 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: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @manishrjain)


query/query.go, line 1637 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

You can get rid of the println here. Just return nil

Done. Added a comment for reference.

@srfrog srfrog merged commit cb4d922 into master Sep 25, 2018
@srfrog srfrog deleted the feature/issue-2610_Invalid_error_for_semantically_correct_query branch September 25, 2018 00:45
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
…ph-io#2611)

* An error was being returned when an empty response is expected.

When testing inequality value vars with non-matching values, the
response was sent as an error although it should return empty result
if the query has correct syntax.

Closes dgraph-io#2610
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.

2 participants