We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_translations
This is breaking the tests for sqlalchemy-continuum:
if self.configure_mappers: > sa.orm.configure_mappers() tests/__init__.py:58: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/mapper.py:4145: in configure_mappers _configure_registries(_all_registries(), cascade=True) /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/mapper.py:4180: in _configure_registries Mapper.dispatch._for_class(Mapper).after_configured() # type: ignore /usr/local/lib/python3.9/site-packages/sqlalchemy/event/attr.py:378: in __call__ fn(*args, **kw) /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/events.py:887: in wrap fn(*arg, **kw) sqlalchemy_i18n/manager.py:110: in configure_translatable_classes RelationshipBuilder(self, cls)() sqlalchemy_i18n/builders.py:228: in __call__ self.assign_translations() sqlalchemy_i18n/builders.py:186: in assign_translations mapper.add_property('_translations', sa.orm.relationship( /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/mapper.py:2406: in add_property prop = self._configure_property(key, prop, init=self.configured) /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/mapper.py:2211: in _configure_property prop.post_instrument_class(self) /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/interfaces.py:1063: in post_instrument_class self.strategy.init_class_attribute(mapper) /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/strategies.py:791: in init_class_attribute _register_attribute( /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/strategies.py:124: in _register_attribute desc = attributes.register_attribute_impl( /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/attributes.py:2596: in register_attribute_impl "_Dispatch[QueryableAttribute[Any]]", manager[key].dispatch /usr/local/lib/python3.9/site-packages/sqlalchemy/event/base.py:460: in __get__ if hasattr(obj, "_slots_dispatch"): /usr/local/lib/python3.9/site-packages/sqlalchemy/orm/attributes.py:469: in __getattr__ return getattr(self.comparator, key) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <sqlalchemy_i18n.comparators.TranslationComparator object at 0x7f18cd8e0f20>, locale = '_slots_dispatch' def __getattr__(self, locale): class_ = self._parentmapper.class_ try: return getattr(class_, '_translation_%s' % locale) except AttributeError: > raise UnknownLocaleError(locale, class_) E sqlalchemy_i18n.exc.UnknownLocaleError: Unknown locale _slots_dispatch given for instance of class <class 'sqlalchemy.orm.decl_api.DeclarativeMeta'>. Locale is not one of ['en', 'fi'] sqlalchemy_i18n/comparators.py:15: UnknownLocaleError
It's caused by https://github.com/sqlalchemy/sqlalchemy/blob/db9a2caa/lib/sqlalchemy/event/base.py#L460 which assumes getattr is a safe method to call on an InstrumentedAttribute, which isn't the case when you want do tricks like this:
article.translations.en.name = 'Some article'
And ultimately caused by passing the TranslationComparator into the _translations relationship.
Not sure what the best fix is, except perhaps to pass through attributes with underscore prefixes and deprecate non-getitem access?
I've got a branch that should make testing easier. I'm also happy to create GitHub actions for building this if it's useful.
In the meantime I'm going to skip the tests for Continuum.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is breaking the tests for sqlalchemy-continuum:
It's caused by https://github.com/sqlalchemy/sqlalchemy/blob/db9a2caa/lib/sqlalchemy/event/base.py#L460 which assumes getattr is a safe method to call on an InstrumentedAttribute, which isn't the case when you want do tricks like this:
And ultimately caused by passing the TranslationComparator into the _translations relationship.
Not sure what the best fix is, except perhaps to pass through attributes with underscore prefixes and deprecate non-getitem access?
I've got a branch that should make testing easier. I'm also happy to create GitHub actions for building this if it's useful.
In the meantime I'm going to skip the tests for Continuum.
The text was updated successfully, but these errors were encountered: