Skip to content

active_history is not implemetned for composites #9460

Closed

Description

@zzzeek

Discussed in #9458

this is not really mainstream public API but the property seems to not be set up

from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy.orm import composite
from sqlalchemy.orm import declarative_base

Base = declarative_base()


class Model(Base):
    __tablename__ = 'model'

    id = Column(Integer, primary_key=True)
    composite = composite(tuple, Column('value_1', Integer), Column('value_2', Integer))

Model.registry.configure()

# this of course should be on the composite
Model.composite.impl.active_history = True
Traceback (most recent call last):
  File "/home/classic/dev/sqlalchemy/test3.py", line 15, in <module>
    Model.composite.impl.active_history = True
  File "/home/classic/dev/sqlalchemy/lib/sqlalchemy/orm/attributes.py", line 925, in _set_active_history
    self.dispatch._active_history = value
AttributeError: '_ProxyImpl' object has no attribute 'dispatch'

Activity

  1. added
    regression
    near-term release
    on Mar 9, 2023
  2. added this to the 2.0.x milestone on Mar 9, 2023
  3. changed the title [-]small regression involving impl.active_history[/-] [+]active_history is not implemetned for composites[/+] on Mar 9, 2023
  4. sqla-tester commented on Mar 9, 2023

    @sqla-tester
    Collaborator

    Mike Bayer has proposed a fix for this issue in the main branch:

    implement active_history for composites https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/4501

  5. pinned this issue on Mar 10, 2023
  6. unpinned this issue on Mar 10, 2023
  7. added a commit that references this issue on Feb 9, 2024
    b09e919
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    near-term releaseormregression

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions