New issue
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
Raise an AttributeError when calling an attribute of _SpatialElement … #238
Conversation
…that do not starts with 'st_'
@adrien-berchet does this fix an actual bug? Do you have a test-case? Thanks. |
#198 spotted that calling |
So if I understand correctly this PR would not fix the issue reported with #198, would it? |
Indeed, it just fixes a undesirable behavior that was revealed in this issue. By the way, I am wondering if we should add a |
@adrien-berchet As I understand it eve uses That being said I agree with the change you're proposing, with a modification to the comment in the code. Indeed, it is not correct to say that "This is not to mess up with SQLAlchemy's use of hasattr/getattr on Column objects" in this case. Instead I'd add this comment : "Raise an AttributeError when the attribute name doesn't start with ST_. This is to be nice with other librairies that use some ducktyping (e.g. hasattr(element, "copy")) to determine the type of the element.". Also I'd be great to add a unit test for this. @adrien-berchet tell me if you have time to modify your branch. I can do it if you don't. Thanks! |
I agree, that's why I think we can just add this fix and answer in the issue that a
Ok. Sorry for this dirty proposal, I wanted your opinion on this before going further. Thanks |
@adrien-berchet see #240. I'll merge it when Travis is happy. |
Perfect, thank you very much! |
Raise an AttributeError when calling an attribute of SpatialElement that do not starts with the 'st' prefix, as in the BaseComparator class.
@elemoine do you think it might break something? (it does not break the tests but I am not sure...)