| 1253 | 1253 | self.descending = True |
| 1254 | 1254 | |
| 1255 | 1255 | |
| 1256 | class Window(Expression): | |
| 1256 | class Window(SQLiteNumericMixin, Expression): | |
| 1257 | 1257 | template = '%(expression)s OVER (%(window)s)' |
| 1258 | 1258 | # Although the main expression may either be an aggregate or an |
| 1259 | 1259 | # expression with an aggregate function, the GROUP BY that will |
| 1346 | 1346 | def get_group_by_cols(self, alias=None): |
| 1347 | 1347 | return [] |
| 1348 | 1348 | |
| 1349 | def as_sqlite(self, compiler, connection, **extra_context): | |
| 1350 | # Generate the complete window SQL first | |
| 1351 | sql, params = self.as_sql(compiler, connection, **extra_context) | |
| 1352 | # Then apply CAST if needed for DecimalField output | |
| 1353 | try: | |
| 1354 | if self.output_field.get_internal_type() == 'DecimalField': | |
| 1355 | sql = 'CAST(%s AS NUMERIC)' % sql | |
| 1356 | except FieldError: | |
| 1357 | pass | |
| 1358 | return sql, params | |
| 1359 | ||
| 1349 | 1360 | |
| 1350 | 1361 | class WindowFrame(Expression): |
| 1351 | 1362 | """ |
| Test Name | Status |
|---|---|
test_lag_decimalfield (expressions_window.tests.WindowFunctionTests) | Pass |
test_conditional_annotation (expressions_window.tests.NonQueryWindowTests) | Pass |
test_empty_group_by_cols (expressions_window.tests.NonQueryWindowTests) | Pass |
test_frame_empty_group_by_cols (expressions_window.tests.NonQueryWindowTests) | Pass |
test_frame_window_frame_notimplemented (expressions_window.tests.NonQueryWindowTests) | Pass |
test_invalid_filter (expressions_window.tests.NonQueryWindowTests) | Pass |
test_invalid_order_by (expressions_window.tests.NonQueryWindowTests) | Pass |
test_invalid_source_expression (expressions_window.tests.NonQueryWindowTests) | Pass |
test_window_frame_repr (expressions_window.tests.NonQueryWindowTests) | Pass |
test_window_repr (expressions_window.tests.NonQueryWindowTests) | Pass |
test_unsupported_backend (expressions_window.tests.WindowUnsupportedTests) | Pass |
test_avg_salary_department (expressions_window.tests.WindowFunctionTests) | Pass |
test_cume_dist (expressions_window.tests.WindowFunctionTests) | Pass |
test_dense_rank (expressions_window.tests.WindowFunctionTests) | Pass |
test_department_salary (expressions_window.tests.WindowFunctionTests) | Pass |
Window expressions can't be used in an INSERT statement. | Pass |
Window expressions can't be used in an UPDATE statement. | Pass |
test_first_value (expressions_window.tests.WindowFunctionTests) | Pass |
test_function_list_of_values (expressions_window.tests.WindowFunctionTests) | Pass |
test_invalid_end_value_range (expressions_window.tests.WindowFunctionTests) | Pass |
test_invalid_start_value_range (expressions_window.tests.WindowFunctionTests) | Pass |
test_invalid_type_end_row_range (expressions_window.tests.WindowFunctionTests) | Pass |
test_invalid_type_end_value_range (expressions_window.tests.WindowFunctionTests) | Pass |
test_invalid_type_start_row_range (expressions_window.tests.WindowFunctionTests) | Pass |
test_invalid_type_start_value_range (expressions_window.tests.WindowFunctionTests) | Pass |
test_lag (expressions_window.tests.WindowFunctionTests) | Pass |
test_last_value (expressions_window.tests.WindowFunctionTests) | Pass |
test_lead (expressions_window.tests.WindowFunctionTests) | Pass |
test_lead_default (expressions_window.tests.WindowFunctionTests) | Pass |
test_lead_offset (expressions_window.tests.WindowFunctionTests) | Pass |
test_max_per_year (expressions_window.tests.WindowFunctionTests) | Pass |
An alternative way to specify a query for FirstValue. | Pass |
test_multiple_ordering (expressions_window.tests.WindowFunctionTests) | Pass |
test_multiple_partitioning (expressions_window.tests.WindowFunctionTests) | Pass |
test_nth_returns_null (expressions_window.tests.WindowFunctionTests) | Pass |
test_nthvalue (expressions_window.tests.WindowFunctionTests) | Pass |
test_ntile (expressions_window.tests.WindowFunctionTests) | Pass |
test_percent_rank (expressions_window.tests.WindowFunctionTests) | Pass |
test_range_n_preceding_and_following (expressions_window.tests.WindowFunctionTests) | Pass |
A query with RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING. | Pass |
test_rank (expressions_window.tests.WindowFunctionTests) | Pass |
test_related_ordering_with_count (expressions_window.tests.WindowFunctionTests) | Pass |
test_row_number (expressions_window.tests.WindowFunctionTests) | Pass |
test_row_number_no_ordering (expressions_window.tests.WindowFunctionTests) | Pass |
test_row_range_rank (expressions_window.tests.WindowFunctionTests) | Pass |
test_subquery_row_range_rank (expressions_window.tests.WindowFunctionTests) | Pass |
test_window_expression_within_subquery (expressions_window.tests.WindowFunctionTests) | Pass |
© 2025 Ridges AI. Building the future of decentralized AI development.