Bug 2458684

Summary: python-django-cacheops fails to build with Python 3.15: IssueTests.test_365 and BasicTests.test_subquery fail
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-django-cacheopsAssignee: Ali Erdinc Koroglu <ali.koroglu>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: aekoroglu, ali.koroglu, fti-bugs, ksurma, mhroncok, python-packagers-sig
Target Milestone: ---Flags: ali.koroglu: needinfo-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-django-cacheops-7.2-5.fc45 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-06-18 19:55:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2412434, 2433833, 2433836    

Description Karolina Surma 2026-04-15 13:41:42 UTC
python-django-cacheops fails to build with Python 3.15.0a8.

___________________________ BasicTests.test_subquery ___________________________

self = <tests.tests.BasicTests testMethod=test_subquery>

    def test_subquery(self):
        categories = Category.objects.cache().filter(title='Django').only('id')
>       Post.objects.cache().filter(category__in=Subquery(categories)).count()
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/tests.py:183: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.15/site-packages/django/db/models/query.py:1542: in filter
    return self._filter_or_exclude(False, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.15/site-packages/django/db/models/query.py:1560: in _filter_or_exclude
    clone._filter_or_exclude_inplace(negate, args, kwargs)
/usr/lib/python3.15/site-packages/django/db/models/query.py:1570: in _filter_or_exclude_inplace
    self._query.add_q(Q(*args, **kwargs))
/usr/lib/python3.15/site-packages/django/db/models/sql/query.py:1676: in add_q
    clause, _ = self._add_q(q_object, can_reuse)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.15/site-packages/django/db/models/sql/query.py:1708: in _add_q
    child_clause, needed_inner = self.build_filter(
/usr/lib/python3.15/site-packages/django/db/models/sql/query.py:1565: in build_filter
    value = self.resolve_lookup_value(value, can_reuse, allow_joins, summarize)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.15/site-packages/django/db/models/sql/query.py:1330: in resolve_lookup_value
    value = value.resolve_expression(
/usr/lib/python3.15/site-packages/django/db/models/expressions.py:1804: in resolve_expression
    self.output_field
/usr/lib/python3.15/site-packages/django/utils/functional.py:47: in __get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <django.db.models.expressions.Subquery object at 0x7fa1af0be120>

    @cached_property
    def output_field(self):
        """Return the output type of this expressions."""
        output_field = self._resolve_output_field()
        if output_field is None:
>           raise OutputFieldIsNoneError(
                "Cannot resolve expression type, unknown output_field"
            )
E           django.db.models.expressions.OutputFieldIsNoneError: Cannot resolve expression type, unknown output_field

/usr/lib/python3.15/site-packages/django/db/models/expressions.py:330: OutputFieldIsNoneError
_____________________________ IssueTests.test_365 ______________________________

self = <tests.tests.IssueTests testMethod=test_365>

    def test_365(self):
        """
        Check that an annotated Subquery is automatically invalidated.
        """
        # Retrieve all Categories and annotate the ID of the most recent Post for each
        newest_post = Post.objects.filter(category=OuterRef('pk')).order_by('-pk').values('pk')
        categories = Category.objects.cache().annotate(newest_post=Subquery(newest_post[:1]))
    
        # Create a new Post in the first Category
        post = Post(category=categories[0], title='Foo')
        post.save()
    
        # Retrieve Categories again, and check that the newest post ID is correct
        categories = Category.objects.cache().annotate(newest_post=Subquery(newest_post[:1]))
>       self.assertEqual(categories[0].newest_post, post.pk)
E       AssertionError: 1 != 4

https://docs.python.org/3.15/whatsnew/3.15.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/10318672-python-django-cacheops/

For all our attempts to build python-django-cacheops with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/python-django-cacheops/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.15:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Karolina Surma 2026-06-06 18:22:03 UTC
*** Bug 2485846 has been marked as a duplicate of this bug. ***

Comment 2 Fedora Fails To Install 2026-06-14 08:31:02 UTC
Hello,

Please note that this comment was generated automatically by https://forge.fedoraproject.org/releng/tooling/src/branch/main/release-process/bug-filing/follow-policy/follow_policy.py
If you feel that this output has mistakes, please open an issue at https://forge.fedoraproject.org/releng/tickets/issues

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 3 Fedora Admin user for bugzilla script actions 2026-06-16 14:06:32 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 4 Fedora Fails To Install 2026-06-18 10:29:38 UTC
Hello,

Please note that this comment was generated automatically by https://forge.fedoraproject.org/releng/tooling/src/branch/main/release-process/bug-filing/follow-policy/follow_policy.py
If you feel that this output has mistakes, please open an issue at https://forge.fedoraproject.org/releng/tickets/issues

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 5 Fedora Update System 2026-06-18 19:51:35 UTC
FEDORA-2026-9f55d72eef (python-django-cacheops-7.2-5.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-9f55d72eef

Comment 6 Fedora Update System 2026-06-18 19:55:16 UTC
FEDORA-2026-9f55d72eef (python-django-cacheops-7.2-5.fc45) has been pushed to the Fedora 45 stable repository.
If problem still persists, please make note of it in this bug report.