Re: [sqlalchemy] Detecting relationship conflicts

2016-07-19 Thread Burak Arslan


On 07/19/16 20:37, Burak Arslan wrote:
>
> On 07/19/16 20:19, Burak Arslan wrote:
>> On 07/19/16 19:38, Mike Bayer wrote:
>>> this warning will be removed in 1.1, see
>>> https://bitbucket.org/zzzeek/sqlalchemy/issues/3749 
>> That's nice but am I to understand there is no easy way to test this? I
>> still wouldn't prefer generating redundant properties.
>>
>>
>
> never mind, this seems to work:
> https://github.com/plq/spyne/blob/9c66b7f98ba24595f574a7c4974402a45f4cdcc8/spyne/test/test_sqlalchemy.py#L347
>


Sorry, it should actually be this one:
https://github.com/plq/spyne/blob/960a48317bc4355f3d35656ac4cedf636aae60c5/spyne/test/test_sqlalchemy.py#L344

In English, I'm comparing relationships identities from parent and child
classes.

FWIW, I had this error in production for years and it seems to never
have caused a problem.

Thanks a lot for your answers.

Best regards,
Burak

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Detecting relationship conflicts

2016-07-19 Thread Mike Bayer



On 07/19/2016 01:37 PM, Burak Arslan wrote:



On 07/19/16 20:19, Burak Arslan wrote:


On 07/19/16 19:38, Mike Bayer wrote:

this warning will be removed in 1.1, see
https://bitbucket.org/zzzeek/sqlalchemy/issues/3749

That's nice but am I to understand there is no easy way to test this? I
still wouldn't prefer generating redundant properties.





never mind, this seems to work:
https://github.com/plq/spyne/blob/9c66b7f98ba24595f574a7c4974402a45f4cdcc8/spyne/test/test_sqlalchemy.py#L347


Didn't realize you actually wanted to guard against this.





burak



--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Detecting relationship conflicts

2016-07-19 Thread Burak Arslan


On 07/19/16 20:19, Burak Arslan wrote:
>
> On 07/19/16 19:38, Mike Bayer wrote:
>> this warning will be removed in 1.1, see
>> https://bitbucket.org/zzzeek/sqlalchemy/issues/3749 
> That's nice but am I to understand there is no easy way to test this? I
> still wouldn't prefer generating redundant properties.
>
>


never mind, this seems to work:
https://github.com/plq/spyne/blob/9c66b7f98ba24595f574a7c4974402a45f4cdcc8/spyne/test/test_sqlalchemy.py#L347

burak

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Detecting relationship conflicts

2016-07-19 Thread Burak Arslan


On 07/19/16 19:38, Mike Bayer wrote:
> this warning will be removed in 1.1, see
> https://bitbucket.org/zzzeek/sqlalchemy/issues/3749 

That's nice but am I to understand there is no easy way to test this? I
still wouldn't prefer generating redundant properties.

Best,
Burak

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Detecting relationship conflicts

2016-07-19 Thread Mike Bayer



On 07/19/2016 08:52 AM, Burak Arslan wrote:

Hi,

Behold this test:

https://github.com/plq/spyne/blob/be189784b02e204b031f25bc748d9236ef7dfc59/spyne/test/test_sqlalchemy.py#L314

This is for Spyne => SQLAlchemy object bridge so please ignore
Spyne-specific stuff in there.

I noticed that this produced warning like this:

/home/plq/.local/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.py:1741:
SAWarning: Warning: relationship 'foos' on mapper 'Mapper|SubBar|bar'
supersedes the same relationship on inherited mapper 'Mapper|Bar|bar';
this can cause dependency issues during flush

So now I wrote a patch that omits relationships from parent classes in
subclasses and that warning is gone. However, my test at the end keeps
failing.

1. Is there any way I can properly test this?


this warning will be removed in 1.1, see 
https://bitbucket.org/zzzeek/sqlalchemy/issues/3749




2. Is there a way to explicitly compile mappers? That lonely
instantiation looks quite weird there.


http://docs.sqlalchemy.org/en/latest/orm/mapping_api.html?highlight=configure_mappers#sqlalchemy.orm.configure_mappers





Best regards,
Burak



--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.