- changed status to wontfix
Alias._copy_internals raises AttributeError
Found in 0.5.6, also appears to be present in trunk.
The implementation of the offending method includes::
baseselectable = baseselectable.selectable
which causes "AttributeError: 'Alias' object has no attribute 'selectable'
" to be raised.
Looking at the implementation of __init__
, shouldn't it be::
baseselectable = baseselectable.element
I only noticed this when I had aliases of aliases. Unfortunately, I was not able to make a small test case that exposes this issue, even with the aliases of aliases.
Comments (5)
-
repo owner -
Account Deleted - changed status to open
- removed status
Sorry for the misleading snippet: the line of code I'm looking at is in
Alias._copy_internals
(lines 2657-2659 in 0.5.6):baseselectable = self.element while isinstance(baseselectable, Alias): baseselectable = baseselectable.selectable
When I referred to the
__init__
method, I meant that it has similar code that works correctly (lines 2621-2623 in 0.5.6):baseselectable = selectable while isinstance(baseselectable, Alias): baseselectable = baseselectable.element
So, it looks like
Alias._copy_internals
should usebaseselectable.element
instead ofbaseselectable.selectable
in thewhile
loop. -
repo owner - changed milestone to 0.5.7
OK, thanks. You'd probably get that issue in conjunction with query.join() or eagerloads - if you can send me a stack trace I can produce a test from that.
-
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.5.7 (automated comment)
- Log in to comment
sorry, what line of code are you looking at ? here is 0.5 branch:
here is trunk:
no access of
baseselectable.selectable
. that's from an old version of SQLA so I think you have some files mixed up.