django-snowflake
django-snowflake copied to clipboard
Add support for interval math with NULL
A queryset like:
Experiment.objects.annotate(shifted=ExpressionWrapper(
F('completed') - Value(None, output_field=DurationField()),
output_field=DateField(),
))
generates
SELECT ("experiment"."completed" - INTERVAL 'NULL MICROSECONDS') AS "shifted" FROM "experiment"
which fails with syntax error line 1 at position 0 unexpected 'NULL'.
On other databases, interval math with a null interval results in NULL. Perhaps this could be fixed in Snowflake.