Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Unclear behavior with "nan" and "inf" query argument values #812

Open
pmantica1 opened this issue Apr 29, 2020 · 1 comment
Open

Unclear behavior with "nan" and "inf" query argument values #812

pmantica1 opened this issue Apr 29, 2020 · 1 comment

Comments

@pmantica1
Copy link
Contributor

pmantica1 commented Apr 29, 2020

We currently also allow "nan" and "inf" as input values for GraphQLFloat and GraphQLDecimal in deserialize_json_argument and in validate_argument_types. However, we don't have a single integration test where with float("nan") or Decimal("inf") arguments.

So we don't really know if we are returning a "standard python representation that can be used in queries" in deserialize_json_argument or if the validation in validate_argument_types "is stricter than the validation done by any specific backend"

So I think that we should either add integration tests proving that these values can be used in database queries or disallow them.

@pmantica1
Copy link
Contributor Author

pmantica1 commented Apr 29, 2020

Did some exploratory work:

For MSSQL, filtering on float("nan") or float("inf") leads to a sqlalchemy ProgrammingError with SQL Server. Filtering on Decimal("nan") or Decimal("inf") doesn't lead to any errors, but filtering on less than < Decimal("inf") lead to no results on the test query.

For OrientDB, it didn't lead to any errors, but filtering on < Decimal("inf") didn't lead to any results either.

For neo4j, filtering on < float("inf") worked. Neo4j doesn't support decimal types.

We don't have numeric tests for redisgraph so I wasn't able to test this.

Disclaimer: I am not sure how to insert "nan" or "inf" values into the target databases and didn't bother to try figuring it out.

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

No branches or pull requests

1 participant