Dataset Viewer
Auto-converted to Parquet Duplicate
repo
stringclasses
1 value
instance_id
stringlengths
20
20
base_commit
stringlengths
40
40
patch
stringlengths
356
10.7k
test_patch
stringlengths
540
11.2k
problem_statement
stringlengths
146
5.34k
hints_text
stringlengths
0
6.77k
created_at
stringdate
2022-04-09 09:38:31
2023-07-17 16:54:19
version
stringclasses
3 values
FAIL_TO_PASS
stringlengths
39
2.25k
PASS_TO_PASS
stringlengths
2
30.1k
environment_setup_commit
stringclasses
3 values
difficulty
stringclasses
3 values
django/django
django__django-15572
0b31e024873681e187b574fe1c4afe5e48aeeecf
diff --git a/django/template/autoreload.py b/django/template/autoreload.py --- a/django/template/autoreload.py +++ b/django/template/autoreload.py @@ -17,7 +17,7 @@ def get_template_directories(): if not isinstance(backend, DjangoTemplates): continue - items.update(cwd / to_path(dir) for ...
diff --git a/tests/template_tests/test_autoreloader.py b/tests/template_tests/test_autoreloader.py --- a/tests/template_tests/test_autoreloader.py +++ b/tests/template_tests/test_autoreloader.py @@ -81,6 +81,17 @@ def test_reset_all_loaders(self, mock_reset): autoreload.reset_loaders() self.assertEqua...
Django 3.2.4+ autoreload breaks on empty string in TEMPLATES DIRS. Description Django versions > 3.2.3 changes the way template dirs are handled, they are now normalized using pathlib.Path. People having an invalid value in TEMPLATESDIRS? will notice that autoreload stops working. "DIRS": os.getenv("TEMPLATES_DIRS", ...
2022-04-09T09:38:31Z
4.1
["test_template_dirs_ignore_empty_path (template_tests.test_autoreloader.TemplateReloadTests)"]
["test_get_template_directories (template_tests.test_autoreloader.Jinja2TemplateReloadTests)", "test_reset_all_loaders (template_tests.test_autoreloader.Jinja2TemplateReloadTests)", "test_watch_for_template_changes (template_tests.test_autoreloader.Jinja2TemplateReloadTests)", "test_get_template_directories (template_t...
647480166bfe7532e8c471fef0146e3a17e6c0c9
<15 min fix
django/django
django__django-15629
694cf458f16b8d340a3195244196980b2dec34fd
diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -823,13 +823,15 @@ def _alter_field( self.execute(self._delete_unique_sql(model, constraint_name)) # Drop incoming FK constraint...
diff --git a/tests/migrations/test_base.py b/tests/migrations/test_base.py --- a/tests/migrations/test_base.py +++ b/tests/migrations/test_base.py @@ -65,6 +65,16 @@ def assertColumnNull(self, table, column, using="default"): def assertColumnNotNull(self, table, column, using="default"): self.assertFalse(...
Errors with db_collation – no propagation to foreignkeys Description (last modified by typonaut) Using db_collation with a pk that also has referenced fks in other models causes foreign key constraint errors in MySQL. With the following models: class Account(models.Model): id = ShortUUIDField(primary_key=True,...
​It seems like this should be addressable by defining a ForeignKey.db_collation property that proxies self.target_field.db_column django/db/models/fields/related.py diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index 11407ac902..f82f787f5c 100644 a b def db_type(self, connection):...
2022-04-23T21:58:24Z
4.1
["AlterField operation of db_collation on primary keys changes any FKs", "Creation of models with a FK to a PK with db_collation."]
["test_reference_field_by_through_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_from_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_name (migrations.test_operations.FieldOperationTests)", "test_references_field_by_remote_field_model (migrations....
647480166bfe7532e8c471fef0146e3a17e6c0c9
1-4 hours
django/django
django__django-15695
647480166bfe7532e8c471fef0146e3a17e6c0c9
diff --git a/django/db/migrations/operations/models.py b/django/db/migrations/operations/models.py --- a/django/db/migrations/operations/models.py +++ b/django/db/migrations/operations/models.py @@ -960,6 +960,9 @@ def database_forwards(self, app_label, schema_editor, from_state, to_state): else: ...
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -2988,6 +2988,11 @@ def test_rename_index_unnamed_index(self): with connection.schema_editor() as editor, self.assertNumQueries(0): ...
RenameIndex() crashes when unnamed index is moving backward and forward. Description RenameIndex() should restore the old auto-generated name when an unnamed index for unique_together is moving backward. Now re-applying RenameIndex() crashes. For example: tests/migrations/test_operations.py diff --git a/tests/migrati...
I understand the issue that arises when one reverses a RenameIndex, but it was made "on purpose" somehow. In https://code.djangoproject.com/ticket/27064, For backwards operations with unnamed old indexes, RenameIndex is a noop. From my understanding, when an unnamed index becomes "named", the idea was that it remained ...
2022-05-16T07:58:51Z
4.1
["test_rename_index_unnamed_index (migrations.test_operations.OperationTests)"]
["test_reference_field_by_through_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_from_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_name (migrations.test_operations.FieldOperationTests)", "test_references_field_by_remote_field_model (migrations....
647480166bfe7532e8c471fef0146e3a17e6c0c9
15 min - 1 hour
django/django
django__django-15731
93cedc82f29076c824d476354527af1150888e4f
diff --git a/django/db/models/manager.py b/django/db/models/manager.py --- a/django/db/models/manager.py +++ b/django/db/models/manager.py @@ -1,5 +1,6 @@ import copy import inspect +from functools import wraps from importlib import import_module from django.db import router @@ -81,11 +82,10 @@ def check(self, **...
diff --git a/tests/basic/tests.py b/tests/basic/tests.py --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -1,3 +1,4 @@ +import inspect import threading from datetime import datetime, timedelta from unittest import mock @@ -736,6 +737,17 @@ def test_manager_methods(self): sorted(self.QUERYSET_PRO...
inspect.signature() returns incorrect signature on manager methods. Description (last modified by Shiva Kumar) inspect.signature returns incorrect signature information when used on queryset methods import inspect from django.db import models class Person(models.Model): name = models.CharField(max_length=100) ...
Tentatively accepted. PR: ​https://github.com/django/django/pull/15731
2022-05-24T12:30:05Z
4.2
["test_manager_method_signature (basic.tests.ManagerTest)"]
["test_autofields_generate_different_values_for_each_instance (basic.tests.ModelInstanceCreationTests)", "test_can_create_instance_using_kwargs (basic.tests.ModelInstanceCreationTests)", "You can initialize a model instance using positional arguments,", "You can leave off the value for an AutoField when creating an", "...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
15 min - 1 hour
django/django
django__django-15732
ce69e34bd646558bb44ea92cecfd98b345a0b3e0
diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -528,7 +528,10 @@ def alter_unique_together(self, model, old_unique_together, new_unique_together) # Deleted uniques for fields in olds....
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -2809,6 +2809,69 @@ def test_alter_unique_together_remove(self): operation.describe(), "Alter unique_together for Pony (0 constraint(...
Cannot drop unique_together constraint on a single field with its own unique=True constraint Description I have an erroneous unique_together constraint on a model's primary key (unique_together = (('id',),)) that cannot be dropped by a migration. Apparently the migration tries to find all unique constraints on the co...
Can you share a traceback that shows how and where the migration fails, please. Here it is: Traceback (most recent call last): File "./bin/django", line 56, in <module> sys.exit(djangorecipe.manage.main('project.settings.local.foobar')) File "/foo/bar/eggs/djangorecipe-1.10-py2.7.egg/djangorecipe/manage.py", line 9, in...
2022-05-24T12:58:31Z
4.2
["test_remove_unique_together_on_unique_field (migrations.test_operations.OperationTests)"]
["test_reference_field_by_through_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_from_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_name (migrations.test_operations.FieldOperationTests)", "test_references_field_by_remote_field_model (migrations....
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
15 min - 1 hour
django/django
django__django-15741
8c0886b068ba4e224dd78104b93c9638b860b398
diff --git a/django/utils/formats.py b/django/utils/formats.py --- a/django/utils/formats.py +++ b/django/utils/formats.py @@ -113,6 +113,7 @@ def get_format(format_type, lang=None, use_l10n=None): use_l10n = settings.USE_L10N if use_l10n and lang is None: lang = get_language() + format_ty...
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py --- a/tests/i18n/tests.py +++ b/tests/i18n/tests.py @@ -1518,6 +1518,9 @@ def test_get_format_modules_lang(self): with translation.override("de", deactivate=True): self.assertEqual(".", get_format("DECIMAL_SEPARATOR", lang="en")) + def te...
django.utils.formats.get_format should allow lazy parameter Description Commit [659d2421c7adb] (fixing #20296) triggered a regression when the date template filter (possibly others are affected too) receives a lazy string, like in some_date|date:_('Y-m-d'). This fails with: TypeError: getattr(): attribute name must b...
2022-05-28T09:52:42Z
4.2
["test_date_lazy (template_tests.filter_tests.test_date.DateTests)", "test_get_format_lazy_format (i18n.tests.FormattingTests)"]
["test_lazy (i18n.tests.TestModels)", "test_safestr (i18n.tests.TestModels)", "get_language_info return the first fallback language info if the lang_info", "test_localized_language_info (i18n.tests.TestLanguageInfo)", "test_unknown_language_code (i18n.tests.TestLanguageInfo)", "test_unknown_language_code_and_country_co...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
<15 min fix
django/django
django__django-15814
5eb6a2b33d70b9889e1cafa12594ad6f80773d3a
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -748,6 +748,7 @@ def deferred_to_data(self, target): cur_model = source.related_model else: cur_model = source....
diff --git a/tests/proxy_models/tests.py b/tests/proxy_models/tests.py --- a/tests/proxy_models/tests.py +++ b/tests/proxy_models/tests.py @@ -395,6 +395,12 @@ def test_proxy_load_from_fixture(self): p = MyPerson.objects.get(pk=100) self.assertEqual(p.name, "Elvis Presley") + def test_select_rela...
QuerySet.only() after select_related() crash on proxy models. Description When I optimize a query using select_related() and only() methods from the proxy model I encounter an error: Windows 10; Python 3.10; Django 4.0.5 Traceback (most recent call last): File "D:\study\django_college\manage.py", line 22, in <module...
Thanks for the report. Would you like to prepare a patch? A regression test is required, e.g. tests/proxy_models/tests.py diff --git a/tests/proxy_models/tests.py b/tests/proxy_models/tests.py index f2f465678b..2081c0cbe3 100644 a b class ProxyModelTests(TestCase): 390390 repr(resp), "<ProxyImprovement: ProxyImprovemen...
2022-07-03T19:10:56Z
4.2
["test_select_related_only (proxy_models.tests.ProxyModelTests)"]
["test_abstract_base_with_model_fields (proxy_models.tests.ProxyModelTests)", "Creating a Person makes them accessible through the MyPerson proxy.", "A new MyPerson also shows up as a standard Person.", "test_concrete_model (proxy_models.tests.ProxyModelTests)", "test_content_type (proxy_models.tests.ProxyModelTests)",...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
15 min - 1 hour
django/django
django__django-15851
b4817d20b9e55df30be0b1b2ca8c8bb6d61aab07
diff --git a/django/db/backends/postgresql/client.py b/django/db/backends/postgresql/client.py --- a/django/db/backends/postgresql/client.py +++ b/django/db/backends/postgresql/client.py @@ -32,9 +32,9 @@ def settings_to_cmd_args_env(cls, settings_dict, parameters): args += ["-h", host] if port: ...
diff --git a/tests/dbshell/test_postgresql.py b/tests/dbshell/test_postgresql.py --- a/tests/dbshell/test_postgresql.py +++ b/tests/dbshell/test_postgresql.py @@ -154,7 +154,7 @@ def test_accent(self): def test_parameters(self): self.assertEqual( self.settings_to_cmd_args_env({"NAME": "dbname...
dbshell additional parameters should be passed before dbname on PostgreSQL. Description psql expects all options to proceed the database name, if provided. So, if doing something like `./manage.py dbshell -- -c "select * from some_table;" one will get this: $ ./manage.py dbshell -- -c "select * from some_table;" psql...
2022-07-18T01:36:33Z
4.2
["test_parameters (dbshell.test_postgresql.PostgreSqlDbshellCommandTestCase)"]
["test_accent (dbshell.test_postgresql.PostgreSqlDbshellCommandTestCase)", "test_basic (dbshell.test_postgresql.PostgreSqlDbshellCommandTestCase)", "test_column (dbshell.test_postgresql.PostgreSqlDbshellCommandTestCase)", "test_crash_password_does_not_leak (dbshell.test_postgresql.PostgreSqlDbshellCommandTestCase)", "t...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
<15 min fix
django/django
django__django-15863
37c5b8c07be104fd5288cd87f101e48cb7a40298
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -149,7 +149,7 @@ def floatformat(text, arg=-1): use_l10n = False arg = arg[:-1] or -1 try: - input_val = repr(text) ...
diff --git a/tests/template_tests/filter_tests/test_floatformat.py b/tests/template_tests/filter_tests/test_floatformat.py --- a/tests/template_tests/filter_tests/test_floatformat.py +++ b/tests/template_tests/filter_tests/test_floatformat.py @@ -56,6 +56,10 @@ def test_inputs(self): self.assertEqual(floatform...
Filter floatformat drops precision in decimal numbers Description I discovered that floatformat template filter may drop precision when used for Decimal numbers. MWE: from decimal import Decimal from django import setup from django.conf import settings from django.template import Template, Context TEMPLATES = [ { ...
2022-07-20T12:58:04Z
4.2
["test_inputs (template_tests.filter_tests.test_floatformat.FunctionTests)"]
["test_floatformat01 (template_tests.filter_tests.test_floatformat.FloatformatTests)", "test_floatformat02 (template_tests.filter_tests.test_floatformat.FloatformatTests)", "test_float_dunder_method (template_tests.filter_tests.test_floatformat.FunctionTests)", "test_force_grouping (template_tests.filter_tests.test_flo...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
<15 min fix
django/django
django__django-15916
88e67a54b7ed0210c11523a337b498aadb2f5187
diff --git a/django/forms/models.py b/django/forms/models.py --- a/django/forms/models.py +++ b/django/forms/models.py @@ -253,18 +253,11 @@ def __init__(self, options=None): self.help_texts = getattr(options, "help_texts", None) self.error_messages = getattr(options, "error_messages", None) ...
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -3496,6 +3496,41 @@ class InheritedForm(NewForm): type(NewForm.base_fields[name].widget), ) + def test_custom_callback_in_meta(self): + def ...
Allow ModelForm meta to specify formfield_callback. Description (last modified by Klaas-Jan Gorter) The function django.forms.modelform_factory returns a form class based on the class it recieves as form argument. As an additional argument it accepts a formfield_callback function. When no callback is provided t...
I was always the impression that formfield_callback was solely an allowed kwarg of the modelform_factory function and its friends. I believe this test has been removed from version 2, because I find no equivalent test in tests/model_formsets_regress. From what I can see the patch from #18573 was never committed and thu...
2022-08-04T18:59:18Z
4.2
["test_custom_callback_from_base_form_meta (model_forms.tests.FormFieldCallbackTests)", "test_custom_callback_in_meta (model_forms.tests.FormFieldCallbackTests)"]
["test_modelform_factory_metaclass (model_forms.tests.CustomMetaclassTestCase)", "Regression test for #12960. Make sure the cleaned_data returned from", "Regression for #12596: Calling super from ModelForm.clean() should be", "test_bad_callback (model_forms.tests.FormFieldCallbackTests)", "Using base forms with widgets...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
15 min - 1 hour
django/django
django__django-15930
63884829acd207404f2a5c3cc1d6b4cd0a822b70
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -1299,6 +1299,11 @@ def as_sql(self, compiler, connection, template=None, **extra_context): template_params = extra_context sql_params = [] ...
diff --git a/tests/expressions_case/tests.py b/tests/expressions_case/tests.py --- a/tests/expressions_case/tests.py +++ b/tests/expressions_case/tests.py @@ -415,6 +415,16 @@ def test_annotate_with_empty_when(self): self.assertEqual(len(objects), CaseTestModel.objects.count()) self.assertTrue(all(obj...
Case() crashes with ~Q(pk__in=[]). Description The following code generates a syntax error. User.objects.annotate( _a=Case( When(~Q(pk__in=[]), then=Value(True)), default=Value(False), output_field=BooleanField(), ) ).order_by("-a").values("pk") The error is: ProgrammingError: syntax error at or near "THEN"...
Thanks for the report (similar to the #33374 and #26517).
2022-08-07T15:26:41Z
4.2
["test_annotate_with_full_when (expressions_case.tests.CaseExpressionTests)"]
["test_empty_q_object (expressions_case.tests.CaseWhenTests)", "test_invalid_when_constructor_args (expressions_case.tests.CaseWhenTests)", "test_only_when_arguments (expressions_case.tests.CaseWhenTests)", "test_conditional_aggregation_example (expressions_case.tests.CaseDocumentationExamples)", "test_conditional_upda...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
<15 min fix
django/django
django__django-15957
f387d024fc75569d2a4a338bfda76cc2f328f627
diff --git a/django/db/models/fields/related_descriptors.py b/django/db/models/fields/related_descriptors.py --- a/django/db/models/fields/related_descriptors.py +++ b/django/db/models/fields/related_descriptors.py @@ -64,8 +64,10 @@ class Child(Model): """ from django.core.exceptions import FieldError -from django...
diff --git a/tests/prefetch_related/tests.py b/tests/prefetch_related/tests.py --- a/tests/prefetch_related/tests.py +++ b/tests/prefetch_related/tests.py @@ -1908,3 +1908,67 @@ def test_nested_prefetch_is_not_overwritten_by_related_object(self): self.assertIs(Room.house.is_cached(self.room), True) wi...
Prefetch objects don't work with slices Description ​Prefetch() objects does not work with sliced querysets. For example the following code results in AssertionError: Cannot filter a query once a slice has been taken.: Category.objects.prefetch_related(Prefetch( 'post_set', queryset=Post.objects.all()[:3], to_attr...
It seems to me that #26565 ("Allow Prefetch query to use .values()") is related. Hi ludwik, #26565 is about a different issue. The only way we could support slices would be to extract it from the provided queryset to make it filterable again and apply it when in-memory joining. The prefect queryset would still have to ...
2022-08-13T06:18:25Z
4.2
["test_foreignkey_reverse (prefetch_related.tests.PrefetchLimitTests)", "test_m2m_forward (prefetch_related.tests.PrefetchLimitTests)", "test_m2m_reverse (prefetch_related.tests.PrefetchLimitTests)", "test_reverse_ordering (prefetch_related.tests.PrefetchLimitTests)"]
["The prefetched relationship is used rather than populating the reverse", "test_bug (prefetch_related.tests.Ticket19607Tests)", "When intermediary results are prefetched without a destination", "In-bulk does correctly prefetch objects by not using .iterator()", "test_prefetch_nullable (prefetch_related.tests.NullableT...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
1-4 hours
django/django
django__django-15973
2480554dc4ada4ecf3f6a08e318735a2e50783f3
diff --git a/django/db/migrations/autodetector.py b/django/db/migrations/autodetector.py --- a/django/db/migrations/autodetector.py +++ b/django/db/migrations/autodetector.py @@ -1422,7 +1422,7 @@ def _get_dependencies_for_foreign_key(app_label, model_name, field, project_stat dependencies = [(dep_app_label, d...
diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py --- a/tests/migrations/test_autodetector.py +++ b/tests/migrations/test_autodetector.py @@ -3585,6 +3585,52 @@ def test_create_with_through_model(self): changes, "testapp", 0, 3, model_name="author", name="publishers...
Defining the "through" model in a many-to-many field in another app causes "AttributeError: 'str' object has no attribute '_meta'" on migration Description I tried migrating my apps into the database, the three relevant apps are called: "fonte", "fonte_variavel" and "variavel". fonte and variavel models have a many-t...
I was able to reproduce the problem with your models. Moving the FonteVariavelModel model to the fonte app seems to work. Even if there's a bug in Django, as a workaround, why not simply move the model?
2022-08-19T18:10:02Z
4.2
["test_create_with_through_model_separate_apps (migrations.test_autodetector.AutodetectorTests)"]
["test_auto (migrations.test_autodetector.MigrationSuggestNameTests)", "test_many_operations_suffix (migrations.test_autodetector.MigrationSuggestNameTests)", "test_no_operations (migrations.test_autodetector.MigrationSuggestNameTests)", "test_no_operations_initial (migrations.test_autodetector.MigrationSuggestNameTest...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
15 min - 1 hour
django/django
django__django-15987
7e6b537f5b92be152779fc492bb908d27fe7c52a
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -367,7 +367,7 @@ def fixture_dirs(self): for app_config in apps.get_app_configs(): app_label...
diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py --- a/tests/fixtures_regress/tests.py +++ b/tests/fixtures_regress/tests.py @@ -569,6 +569,20 @@ def test_fixture_dirs_with_default_fixture_path(self): with self.assertRaisesMessage(ImproperlyConfigured, msg): managemen...
Fixture dirs duplicates undetected if dir is Path instance Description When FIXTURE_DIRS contains Path instances, the duplicate check in loaddata does not detect duplicates.
2022-08-23T10:07:03Z
4.2
["settings.FIXTURE_DIRS cannot contain a default fixtures directory"]
["test_fixtures_loaded (fixtures_regress.tests.TestLoadFixtureFromOtherAppDirectory)", "Natural keys with foreing keys in dependencies works in a multiple", "M2M relations with explicit through models should NOT count as", "Circular M2M relations with explicit through models should be serializable", "M2M relations with...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
<15 min fix
django/django
django__django-16032
0c3981eb5094419fe200eb46c71b5376a2266166
diff --git a/django/db/models/fields/related_lookups.py b/django/db/models/fields/related_lookups.py --- a/django/db/models/fields/related_lookups.py +++ b/django/db/models/fields/related_lookups.py @@ -93,7 +93,6 @@ def get_prep_lookup(self): elif not getattr(self.rhs, "has_select_fields", True) and not g...
diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py --- a/tests/annotations/tests.py +++ b/tests/annotations/tests.py @@ -989,6 +989,34 @@ def test_annotation_filter_with_subquery(self): publisher_books_qs, [{"name": "Sams"}, {"name": "Morgan Kaufmann"}] ) + def test_annotati...
__in doesn't clear selected fields on the RHS when QuerySet.alias() is used after annotate(). Description Here is a test case to reproduce the bug, you can add this in tests/annotations/tests.py def test_annotation_and_alias_filter_in_subquery(self): long_books_qs = ( Book.objects.filter( pages__gt=400, ...
This is a ​documented and expected behavior. Using either .alias or .annotate works as expected without using .values to limit to 1 column. Why is that? but using both of them doesn't seem work. Replying to Gabriel Muj: Using either .alias or .annotate works as expected without using .values to limit to 1 column. Why i...
2022-09-06T09:54:57Z
4.2
["test_annotation_and_alias_filter_in_subquery (annotations.tests.NonAggregateAnnotationTestCase)", "test_annotation_and_alias_filter_related_in_subquery (annotations.tests.NonAggregateAnnotationTestCase)"]
["test_aggregate_alias (annotations.tests.AliasTests)", "test_alias_after_annotation (annotations.tests.AliasTests)", "test_alias_annotate_with_aggregation (annotations.tests.AliasTests)", "test_alias_annotation_expression (annotations.tests.AliasTests)", "test_alias_default_alias_expression (annotations.tests.AliasTes...
0fbdb9784da915fce5dcc1fe82bac9b4785749e5
15 min - 1 hour
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
9