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

django: fix comparisons for DATE and INT64 #356

Closed
1 task
odeke-em opened this issue Mar 18, 2020 · 1 comment
Closed
1 task

django: fix comparisons for DATE and INT64 #356

odeke-em opened this issue Mar 18, 2020 · 1 comment
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@odeke-em
Copy link
Contributor

Coming here from #353 with test failure:

  • expressions_case.tests.CaseDocumentationExamples.test_filter_example
======================================================================
ERROR: test_filter_example (expressions_case.tests.CaseDocumentationExamples)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/.virtualenvs/django37/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 79, in next
    return six.next(self._wrapped)
  File "/home/tim/.virtualenvs/django37/lib/python3.7/site-packages/grpc/_channel.py", line 392, in __next__
    return self._next()
  File "/home/tim/.virtualenvs/django37/lib/python3.7/site-packages/grpc/_channel.py", line 561, in _next
    raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
	status = StatusCode.INVALID_ARGUMENT
	details = "No matching signature for operator <= for argument types: DATE, INT64. Supported signature: ANY <= ANY [at 1:177]\n...account_type FROM expressions_case_client WHERE expressions_case_client.re...\n                                                   ^"
	debug_error_string = "{"created":"@1577631809.151432362","description":"Error received from peer ipv4:172.217.10.234:443","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"No matching signature for operator <= for argument types: DATE, INT64. Supported signature: ANY <= ANY [at 1:177]\n...account_type FROM expressions_case_client WHERE expressions_case_client.re...\n                                                   ^","grpc_status":3}"
>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tim/code/spanner-orm/spanner/dbapi/cursor.py", line 91, in execute
    self.__handle_DQL(sql, args or None)
  File "/home/tim/code/spanner-orm/spanner/dbapi/cursor.py", line 183, in __handle_DQL
    self.__itr = PeekIterator(self.__res)
  File "/home/tim/code/spanner-orm/spanner/dbapi/cursor.py", line 322, in __init__
    head = next(itr_src)
  File "/home/tim/.virtualenvs/django37/lib/python3.7/site-packages/google/cloud/spanner_v1/streamed.py", line 143, in __iter__
    self._consume_next()
  File "/home/tim/.virtualenvs/django37/lib/python3.7/site-packages/google/cloud/spanner_v1/streamed.py", line 116, in _consume_next
    response = six.next(self._response_iterator)
  File "/home/tim/.virtualenvs/django37/lib/python3.7/site-packages/google/cloud/spanner_v1/snapshot.py", line 45, in _restart_on_unavailable
    for item in iterator:
  File "/home/tim/.virtualenvs/django37/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 81, in next
    six.raise_from(exceptions.from_grpc_error(exc), exc)
  File "<string>", line 3, in raise_from
google.api_core.exceptions.InvalidArgument: 400 No matching signature for operator <= for argument types: DATE, INT64. Supported signature: ANY <= ANY [at 1:177]\n...account_type FROM expressions_case_client WHERE expressions_case_client.re...\n                                                   ^

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tim/code/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/spanner-orm/spanner/dbapi/cursor.py", line 99, in execute
    raise ProgrammingError(e.details if hasattr(e, 'details') else e)
spanner.dbapi.exceptions.ProgrammingError: 400 No matching signature for operator <= for argument types: DATE, INT64. Supported signature: ANY <= ANY [at 1:177]\n...account_type FROM expressions_case_client WHERE expressions_case_client.re...\n                                                   ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tim/code/django/tests/expressions_case/tests.py", line 1301, in test_filter_example
    transform=attrgetter('name', 'account_type')
  File "/home/tim/code/django/django/test/testcases.py", line 1047, in assertQuerysetEqual
    items = map(transform, qs)
  File "/home/tim/code/django/django/db/models/query.py", line 274, in __iter__
    self._fetch_all()
  File "/home/tim/code/django/django/db/models/query.py", line 1242, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/home/tim/code/django/django/db/models/query.py", line 55, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 1133, in execute_sql
    cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/home/tim/code/django/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/home/tim/code/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/tim/code/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/spanner-orm/spanner/dbapi/cursor.py", line 99, in execute
    raise ProgrammingError(e.details if hasattr(e, 'details') else e)
django.db.utils.ProgrammingError: 400 No matching signature for operator <= for argument types: DATE, INT64. Supported signature: ANY <= ANY [at 1:177]\n...account_type FROM expressions_case_client WHERE expressions_case_client.re...\n                                                   ^
@timgraham
Copy link
Contributor

timgraham commented Mar 18, 2020

This issue doesn't appear anymore (fixed in 6650fae).

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants