Re: [sqlalchemy] migrating to 1.4 and sql.and_()

2021-06-22 Thread Julien Cigar
On Mon, Jun 21, 2021 at 12:04:48PM -0400, Mike Bayer wrote:
> hi -
>

Hello,

> can you please create a self-contained MCVE and post to 
> https://github.com/sqlalchemy/sqlalchemy/issues - thanks.

I've created a ticket with a MCVE 
https://github.com/sqlalchemy/sqlalchemy/issues/6661

Have a nice day,
Julien

> 
> - mike
> 
> 
> 
> On Mon, Jun 21, 2021, at 5:25 AM, Julien Cigar wrote:
> > ok .. :) 
> > 
> > Another regression from 1.3: I have two deferred column_property on my
> > mapped class (1) and with (2) I'm getting a
> > sqlalchemy.exc.ProgrammingError: sqlalchemy.exc.ProgrammingError:
> > (psycopg2.errors.InvalidColumnReference) WITH query "parents" has 21
> > columns available but 23 columns specified.
> > 
> > The generated query is (3), which is wrong: it includes deferred columns
> > in the WITH RECUSRIVE statement but don't load them in the SELECT
> > clause. If I'm set deferred=False in (1) then is works as expected
> > (generated query is (4))
> > 
> > (1) 
> > https://github.com/silenius/amnesia/blob/dev/amnesia/modules/content/mapper.py#L117-L130
> > (2) https://gist.github.com/silenius/34ce40ed288c6a681058ab064147bd70
> > (3) https://gist.github.com/silenius/02a8c2481f77ca1a1ec05bfad830821d
> > (4) https://gist.github.com/silenius/5de95ceddd14e62bfc3e52366643bd32
> > 
> > Julien
> > 
> > On Fri, Jun 18, 2021 at 10:11:10AM -0400, Mike Bayer wrote:
> > > 
> > > that's a really obscure API you found there. Coverage for that wasn't 
> > > carried along to 1.4 unfortunately so you'd need to assemble that list 
> > > outside of the and_() first for now. 
> > > 
> > > 
> > > On Fri, Jun 18, 2021, at 4:08 AM, Julien Cigar wrote:
> > > > Hello,
> > > > 
> > > > While updating SQLAlchemy dependency to 1.4 (from 1.3) I noticed that I
> > > > couldn't use .append() on an existing sql.and_() clause .. is it
> > > > expected..?
> > > > 
> > > > The problematic code is
> > > > https://gist.github.com/silenius/7d3043d64fddaa8474dcd062e23ced44 (line
> > > > 18-21)
> > > > 
> > > > Another example that worked with 1.3: 
> > > > https://gist.github.com/silenius/2054e7dc690946c0122c72e6b05f1433
> > > > 
> > > > Thanks,
> > > > Julien
> > > > 
> > > > -- 
> > > > Julien Cigar
> > > > Belgian Biodiversity Platform (http://www.biodiversity.be)
> > > > PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> > > > No trees were killed in the creation of this message.
> > > > However, many electrons were terribly inconvenienced.
> > > > 
> > > > -- 
> > > > SQLAlchemy - 
> > > > The Python SQL Toolkit and Object Relational Mapper
> > > > 
> > > > http://www.sqlalchemy.org/
> > > > 
> > > > To post example code, please provide an MCVE: Minimal, Complete, and 
> > > > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > > > description.
> > > > --- 
> > > > 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 view this discussion on the web visit 
> > > > https://groups.google.com/d/msgid/sqlalchemy/20210618080804.b47v72c3whdaluyh%40x1.
> > > > 
> > > 
> > > -- 
> > > SQLAlchemy - 
> > > The Python SQL Toolkit and Object Relational Mapper
> > > 
> > > http://www.sqlalchemy.org/
> > > 
> > > To post example code, please provide an MCVE: Minimal, Complete, and 
> > > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > > description.
> > > --- 
> > > 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 view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/sqlalchemy/31f1f804-21f2-4faa-9a71-ef356149248a%40www.fastmail.com.
> > 
> > -- 
> > Julien Cigar
> > Belgian Biodiversity Platform (http://www.biodiversity.be)
> > PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> > No trees were killed in the creation of this message.
> > However, many electrons were terribly inconvenienced.
> > 
> > -- 
> > SQLAlchemy - 
> > The Python SQL Toolkit and Object Relational Mapper
> > 
> > http://www.sqlalchemy.org/
> > 
> > To post example code, please provide an MCVE: Minimal, Complete, and 
> > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > description.
> > --- 
> > 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 
> > 

Re: [sqlalchemy] migrating to 1.4 and sql.and_()

2021-06-21 Thread Mike Bayer
hi -

can you please create a self-contained MCVE and post to 
https://github.com/sqlalchemy/sqlalchemy/issues - thanks.

- mike



On Mon, Jun 21, 2021, at 5:25 AM, Julien Cigar wrote:
> ok .. :) 
> 
> Another regression from 1.3: I have two deferred column_property on my
> mapped class (1) and with (2) I'm getting a
> sqlalchemy.exc.ProgrammingError: sqlalchemy.exc.ProgrammingError:
> (psycopg2.errors.InvalidColumnReference) WITH query "parents" has 21
> columns available but 23 columns specified.
> 
> The generated query is (3), which is wrong: it includes deferred columns
> in the WITH RECUSRIVE statement but don't load them in the SELECT
> clause. If I'm set deferred=False in (1) then is works as expected
> (generated query is (4))
> 
> (1) 
> https://github.com/silenius/amnesia/blob/dev/amnesia/modules/content/mapper.py#L117-L130
> (2) https://gist.github.com/silenius/34ce40ed288c6a681058ab064147bd70
> (3) https://gist.github.com/silenius/02a8c2481f77ca1a1ec05bfad830821d
> (4) https://gist.github.com/silenius/5de95ceddd14e62bfc3e52366643bd32
> 
> Julien
> 
> On Fri, Jun 18, 2021 at 10:11:10AM -0400, Mike Bayer wrote:
> > 
> > that's a really obscure API you found there. Coverage for that wasn't 
> > carried along to 1.4 unfortunately so you'd need to assemble that list 
> > outside of the and_() first for now. 
> > 
> > 
> > On Fri, Jun 18, 2021, at 4:08 AM, Julien Cigar wrote:
> > > Hello,
> > > 
> > > While updating SQLAlchemy dependency to 1.4 (from 1.3) I noticed that I
> > > couldn't use .append() on an existing sql.and_() clause .. is it
> > > expected..?
> > > 
> > > The problematic code is
> > > https://gist.github.com/silenius/7d3043d64fddaa8474dcd062e23ced44 (line
> > > 18-21)
> > > 
> > > Another example that worked with 1.3: 
> > > https://gist.github.com/silenius/2054e7dc690946c0122c72e6b05f1433
> > > 
> > > Thanks,
> > > Julien
> > > 
> > > -- 
> > > Julien Cigar
> > > Belgian Biodiversity Platform (http://www.biodiversity.be)
> > > PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> > > No trees were killed in the creation of this message.
> > > However, many electrons were terribly inconvenienced.
> > > 
> > > -- 
> > > SQLAlchemy - 
> > > The Python SQL Toolkit and Object Relational Mapper
> > > 
> > > http://www.sqlalchemy.org/
> > > 
> > > To post example code, please provide an MCVE: Minimal, Complete, and 
> > > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > > description.
> > > --- 
> > > 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 view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/sqlalchemy/20210618080804.b47v72c3whdaluyh%40x1.
> > > 
> > 
> > -- 
> > SQLAlchemy - 
> > The Python SQL Toolkit and Object Relational Mapper
> > 
> > http://www.sqlalchemy.org/
> > 
> > To post example code, please provide an MCVE: Minimal, Complete, and 
> > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > description.
> > --- 
> > 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 view this discussion on the web visit 
> > https://groups.google.com/d/msgid/sqlalchemy/31f1f804-21f2-4faa-9a71-ef356149248a%40www.fastmail.com.
> 
> -- 
> Julien Cigar
> Belgian Biodiversity Platform (http://www.biodiversity.be)
> PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> No trees were killed in the creation of this message.
> However, many electrons were terribly inconvenienced.
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/20210621092524.pzzpcnn5nkuxsr6y%40x1.
> 

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You 

Re: [sqlalchemy] migrating to 1.4 and sql.and_()

2021-06-21 Thread Julien Cigar
ok .. :) 

Another regression from 1.3: I have two deferred column_property on my
mapped class (1) and with (2) I'm getting a
sqlalchemy.exc.ProgrammingError: sqlalchemy.exc.ProgrammingError:
(psycopg2.errors.InvalidColumnReference) WITH query "parents" has 21
columns available but 23 columns specified.

The generated query is (3), which is wrong: it includes deferred columns
in the WITH RECUSRIVE statement but don't load them in the SELECT
clause. If I'm set deferred=False in (1) then is works as expected
(generated query is (4))

(1) 
https://github.com/silenius/amnesia/blob/dev/amnesia/modules/content/mapper.py#L117-L130
(2) https://gist.github.com/silenius/34ce40ed288c6a681058ab064147bd70
(3) https://gist.github.com/silenius/02a8c2481f77ca1a1ec05bfad830821d
(4) https://gist.github.com/silenius/5de95ceddd14e62bfc3e52366643bd32

Julien

On Fri, Jun 18, 2021 at 10:11:10AM -0400, Mike Bayer wrote:
> 
> that's a really obscure API you found there. Coverage for that wasn't 
> carried along to 1.4 unfortunately so you'd need to assemble that list 
> outside of the and_() first for now. 
> 
> 
> On Fri, Jun 18, 2021, at 4:08 AM, Julien Cigar wrote:
> > Hello,
> > 
> > While updating SQLAlchemy dependency to 1.4 (from 1.3) I noticed that I
> > couldn't use .append() on an existing sql.and_() clause .. is it
> > expected..?
> > 
> > The problematic code is
> > https://gist.github.com/silenius/7d3043d64fddaa8474dcd062e23ced44 (line
> > 18-21)
> > 
> > Another example that worked with 1.3: 
> > https://gist.github.com/silenius/2054e7dc690946c0122c72e6b05f1433
> > 
> > Thanks,
> > Julien
> > 
> > -- 
> > Julien Cigar
> > Belgian Biodiversity Platform (http://www.biodiversity.be)
> > PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> > No trees were killed in the creation of this message.
> > However, many electrons were terribly inconvenienced.
> > 
> > -- 
> > SQLAlchemy - 
> > The Python SQL Toolkit and Object Relational Mapper
> > 
> > http://www.sqlalchemy.org/
> > 
> > To post example code, please provide an MCVE: Minimal, Complete, and 
> > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > description.
> > --- 
> > 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 view this discussion on the web visit 
> > https://groups.google.com/d/msgid/sqlalchemy/20210618080804.b47v72c3whdaluyh%40x1.
> > 
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/31f1f804-21f2-4faa-9a71-ef356149248a%40www.fastmail.com.

-- 
Julien Cigar
Belgian Biodiversity Platform (http://www.biodiversity.be)
PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/20210621092524.pzzpcnn5nkuxsr6y%40x1.


Re: [sqlalchemy] migrating to 1.4 and sql.and_()

2021-06-18 Thread Mike Bayer

that's a really obscure API you found there. Coverage for that wasn't 
carried along to 1.4 unfortunately so you'd need to assemble that list outside 
of the and_() first for now. 


On Fri, Jun 18, 2021, at 4:08 AM, Julien Cigar wrote:
> Hello,
> 
> While updating SQLAlchemy dependency to 1.4 (from 1.3) I noticed that I
> couldn't use .append() on an existing sql.and_() clause .. is it
> expected..?
> 
> The problematic code is
> https://gist.github.com/silenius/7d3043d64fddaa8474dcd062e23ced44 (line
> 18-21)
> 
> Another example that worked with 1.3: 
> https://gist.github.com/silenius/2054e7dc690946c0122c72e6b05f1433
> 
> Thanks,
> Julien
> 
> -- 
> Julien Cigar
> Belgian Biodiversity Platform (http://www.biodiversity.be)
> PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> No trees were killed in the creation of this message.
> However, many electrons were terribly inconvenienced.
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/20210618080804.b47v72c3whdaluyh%40x1.
> 

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/31f1f804-21f2-4faa-9a71-ef356149248a%40www.fastmail.com.


Re: [sqlalchemy] migrating to 1.4 and sql.and_()

2021-06-18 Thread Julien Cigar
On Fri, Jun 18, 2021 at 10:08:04AM +0200, Julien Cigar wrote:
> Hello,
> 
> While updating SQLAlchemy dependency to 1.4 (from 1.3) I noticed that I
> couldn't use .append() on an existing sql.and_() clause .. is it
> expected..?

I forgot to add that the error I get is:

Traceback (most recent call last):
  File 
"/usr/home/julien/code/venvs/riparias/lib/python3.7/site-packages/sqlalchemy/sql/elements.py",
 line 826, in __getattr__
return getattr(self.comparator, key)
AttributeError: 'Comparator' object has no attribute '_text_converter_role'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/home/julien/code/venvs/riparias/lib/python3.7/site-packages/sqlalchemy/sql/elements.py",
 line 2302, in append
coercions.expect(self._text_converter_role, clause).self_group(
  File 
"/usr/home/julien/code/venvs/riparias/lib/python3.7/site-packages/sqlalchemy/sql/elements.py",
 line 837, in __getattr__
replace_context=err,
  File 
"/usr/home/julien/code/venvs/riparias/lib/python3.7/site-packages/sqlalchemy/util/compat.py",
 line 207, in raise_
raise exception
AttributeError: Neither 'BooleanClauseList' object nor 'Comparator' object has 
an attribute '_text_converter_role'

> 
> The problematic code is
> https://gist.github.com/silenius/7d3043d64fddaa8474dcd062e23ced44 (line
> 18-21)
> 
> Another example that worked with 1.3: 
> https://gist.github.com/silenius/2054e7dc690946c0122c72e6b05f1433
> 
> Thanks,
> Julien
> 
> -- 
> Julien Cigar
> Belgian Biodiversity Platform (http://www.biodiversity.be)
> PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> No trees were killed in the creation of this message.
> However, many electrons were terribly inconvenienced.
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/20210618080804.b47v72c3whdaluyh%40x1.

-- 
Julien Cigar
Belgian Biodiversity Platform (http://www.biodiversity.be)
PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/20210618092135.7f7iwlpy7oxpzgjb%40x1.


[sqlalchemy] migrating to 1.4 and sql.and_()

2021-06-18 Thread Julien Cigar
Hello,

While updating SQLAlchemy dependency to 1.4 (from 1.3) I noticed that I
couldn't use .append() on an existing sql.and_() clause .. is it
expected..?

The problematic code is
https://gist.github.com/silenius/7d3043d64fddaa8474dcd062e23ced44 (line
18-21)

Another example that worked with 1.3: 
https://gist.github.com/silenius/2054e7dc690946c0122c72e6b05f1433

Thanks,
Julien

-- 
Julien Cigar
Belgian Biodiversity Platform (http://www.biodiversity.be)
PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/20210618080804.b47v72c3whdaluyh%40x1.