Skip to content

django: implement DatabaseOperations.date_interval_sql() #184

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

Closed
timgraham opened this issue Dec 13, 2019 · 0 comments
Closed

django: implement DatabaseOperations.date_interval_sql() #184

timgraham opened this issue Dec 13, 2019 · 0 comments
Assignees
Labels
django-test-suite 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@timgraham
Copy link
Contributor

Example failure:

======================================================================
ERROR: test_update_with_timedelta (timezones.tests.NewDatabaseTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/tests/timezones/tests.py", line 515, in test_update_with_timedelta
    Event.objects.update(dt=F('dt') + timedelta(hours=2))
  File "/home/tim/code/django/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/tim/code/django/django/db/models/query.py", line 741, in update
    rows = query.get_compiler(self.db).execute_sql(CURSOR)
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 1462, in execute_sql
    cursor = super().execute_sql(result_type)
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 1120, in execute_sql
    sql, params = self.as_sql()
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 1437, in as_sql
    sql, params = self.compile(val)
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 405, in compile
    sql, params = node.as_sql(self, self.connection)
  File "/home/tim/code/django/django/db/models/expressions.py", line 428, in as_sql
    return DurationExpression(self.lhs, self.connector, self.rhs).as_sql(compiler, connection)
  File "/home/tim/code/django/django/db/models/expressions.py", line 474, in as_sql
    sql, params = self.compile(self.rhs, compiler, connection)
  File "/home/tim/code/django/django/db/models/expressions.py", line 465, in compile
    return compiler.compile(side)
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 405, in compile
    sql, params = node.as_sql(self, self.connection)
  File "/home/tim/code/django/django/db/models/expressions.py", line 683, in as_sql
    return connection.ops.date_interval_sql(self.value), []
  File "/home/tim/code/django/django/db/backends/base/operations.py", line 102, in date_interval_sql
    raise NotImplementedError('subclasses of BaseDatabaseOperations may require a date_interval_sql() method')
NotImplementedError: subclasses of BaseDatabaseOperations may require a date_interval_sql() method
@timgraham timgraham self-assigned this Dec 17, 2019
@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
django-test-suite 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants