File tree Expand file tree Collapse file tree
packages/django-google-spanner/django_spanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -257,8 +257,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
257257 # https://github.com/orijtech/django-spanner/issues/331
258258 'expressions.tests.ExpressionOperatorTests.test_lefthand_division' ,
259259 'expressions.tests.ExpressionOperatorTests.test_right_hand_division' ,
260- # power operator doesn't work:
261- # https://github.com/orijtech/django-spanner/issues/333
260+ # power operator produces a float result, which can't be assigned to
261+ # an integer column:
262+ # https://github.com/orijtech/django-spanner/issues/331
262263 'expressions.tests.ExpressionOperatorTests.test_lefthand_power' ,
263264 'expressions.tests.ExpressionOperatorTests.test_righthand_power' ,
264265 # Cloud Spanner's docs: "The rows that are returned by LIMIT and OFFSET
Original file line number Diff line number Diff line change @@ -214,6 +214,8 @@ def format_for_duration_arithmetic(self, sql):
214214 def combine_expression (self , connector , sub_expressions ):
215215 if connector == '%%' :
216216 return 'MOD(%s)' % ', ' .join (sub_expressions )
217+ elif connector == '^' :
218+ return 'POWER(%s)' % ', ' .join (sub_expressions )
217219 return super ().combine_expression (connector , sub_expressions )
218220
219221 def combine_duration_expression (self , connector , sub_expressions ):
You can’t perform that action at this time.
0 commit comments