mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-19 15:12:04 -04:00
1c5ec1e609
Fixed regression where calling upon :meth:`_orm.Query.count` in conjunction with a loader option such as :func:`_orm.joinedload` would fail to ignore the loader option. This is a behavior that has always been very specific to the :meth:`_orm.Query.count` method; an error is normally raised if a given :class:`_orm.Query` has options that don't apply to what it is returning. Specifically, the call to enable_eagerloads(False) inside of _from_self() is not needed as loader options are now not invoked for subqueries. Instead, set enable_eagerloads(False) in the count() method itself, so that these options won't be considered in this specific case. Fixes: #6052 Change-Id: I0059ed3fb06156ef4116fd015cbef6f89808e8ef