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

Receive communication error when Athena returns NaN value #2544

Closed
tdawber opened this issue May 17, 2018 · 1 comment
Closed

Receive communication error when Athena returns NaN value #2544

tdawber opened this issue May 17, 2018 · 1 comment

Comments

@tdawber
Copy link
Contributor

tdawber commented May 17, 2018

Issue Summary

When Athena returns a NaN or Infinity value, generally as a result of dividing by 0.0, the following error is displayed:

“Error running query: failed communicating with server. Please check your Internet connection and try again.”

This error message is confusing, and the result could also be handled more nicely.

Steps to Reproduce

  1. execute the following query on an Athena connection:

select 1.0/0.0

When you divide an integer value by an integer zero (select 1/0), Athena throws the error "Error running query: DIVISION_BY_ZERO: / by zero" and this is presented nicely in Redash.

It would be good if either Redash throw a meaningful error upon being unable to handle the Infinity/Nan value, or if it displayed all results and presented null or some other value in place of Infinity/Nan.

Technical details:

  • Redash Version: 4.0.1
@arikfr
Copy link
Member

arikfr commented Jul 19, 2018

The issue is due to json.dumps sending the value as Infinity, which is considered an error by the JSON parser in the browser (see example below).

{  
   "query_result":{  
      "data":{  
         "rows":[  
            {  
               "_col0":Infinity
            }
         ],
     }
   }
}

So there are two issues here:

  1. We show the wrong message to the user: there wasn't a communication error, but we failed to parse the response.
  2. We should send values the browser understands... Although I'm not sure what we should send in such case? null?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants