Re: [sqlalchemy] sqlalchemy.select().group_by(expr) doesn't use label of expression, while .order_by(expr) does

2017-10-25 Thread Gijs Molenaar


Op vrijdag 20 oktober 2017 19:11:56 UTC+2 schreef Mike Bayer:
>
> On Thu, Oct 19, 2017 at 4:25 AM, Gijs Molenaar <gijsmo...@gmail.com 
> > wrote: 
> > 
> > 
> > Op donderdag 19 oktober 2017 03:10:21 UTC+2 schreef Mike Bayer: 
> >> 
> >> On Wed, Oct 18, 2017 at 7:38 AM, Gijs Molenaar <gijsmo...@gmail.com> 
> >> wrote: 
> >> > hi! 
> >> > 
> >> > 
> >> > Not sure if this a bug or something I should in my SQLAlchemy 
> dialect, 
> >> > but 
> >> > currently 
> >> > 
> >> > 
> >> > expr = (table.c.x + table.c.y).label('lx') 
> >> > select([func.count(table.c.id), expr]).group_by(expr).order_by(expr) 
> >> > 
> >> > compiles to: 
> >> > 
> >> > SELECT count(some_table.id) AS count_1, some_table.x + some_table.y 
> AS 
> >> > lx 
> >> > \nFROM some_table GROUP BY some_table.x + some_table.y ORDER BY lx; 
> >> > 
> >> > 
> >> > which works fine for for example sqlite, but MonetDB requires the use 
> of 
> >> > the 
> >> > lx label in the GROUP BY, which I think makes sense? Should this be 
> >> > addressed on the SQLalchemy side or on the MonetDB dialect side? 
> >> 
> >> so this was overhauled in 
> >> 
> >> 
> http://docs.sqlalchemy.org/en/latest/changelog/migration_09.html#label-constructs-can-now-render-as-their-name-alone-in-an-order-by
>  
> >> where we changed ORDER BY to use the label name when the expression is 
> >> passed. 
> >> 
> >> so the immediate answer would be to not actually order by the label(). 
> > 
> > 
> > I think i didn't formulate my e-mail correctly. The ORDER BY is not the 
> > problem, it is the GROUP BY that requires a label. If the GROUP BY 
> doesn't 
> > use a label (just like ORDER BY), MonetDB doesn't want to eat the query. 
>
> this is my fault because I read/reply to these emails very fast and 
> focus mainly on the code I see.If you want it the other way 
> around, there is the feature described at: 
>
>
> https://docs.sqlalchemy.org/en/latest/changelog/migration_10.html#order-by-and-group-by-are-special-cases
>  
>
> that is, say group_by("somelabel"). 
>
> If you need this to be more automatic for this backend, we can look 
> into seeing how the "ORDER BY" version of the feature can be more 
> generalized on a backend-specific basis but this would be longer-term. 
>
>
Hi Mike,

My main concern is to get the test suite pass for now :) What you propose 
doesn't make the dialect work with the current test suite right?

greetings,

 - Gijs 

-- 
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 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.


[sqlalchemy] DESC index in test

2017-10-20 Thread Gijs Molenaar
Hi!

I don't think this is standard SQL? At least MonetDB doesn't support it, 
and I can't find a way to disable this apart from overriding the test:

https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/testing/suite/test_reflection.py#L128

greetings,

 - Gijs

-- 
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 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] missing select() in CompoundSelectTest ?

2017-10-19 Thread Gijs Molenaar


Op donderdag 19 oktober 2017 03:22:31 UTC+2 schreef Mike Bayer:
>
> On Wed, Oct 18, 2017 at 10:18 AM, Gijs Molenaar <gijsmo...@gmail.com 
> > wrote: 
> > Hi again! 
> > 
> > This is the hopefully the last mail since this is the last failing test 
> for 
> > the MonetDB dialect! 
> > 
> > I noticed that some tests in the CompoundSelectTest class do a select() 
> on 
> > the union: 
> > 
> > 
> https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/testing/suite/test_select.py#L298
>  
> > 
> > While others don't, for example: 
> > 
> > 
> https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/testing/suite/test_select.py#L283
>  
> > 
> > MonetDB is having a bit of problems processing unions without a 
> enclosing 
> > select statement. 
> > 
> > So question again is, is this a mistake in the test, or should the 
> MonetDB 
> > dialect be smart enough to handle this? 
>
> without the enclosing select, that test generates this: 
>
> SELECT DISTINCT some_table.id, some_table.x, some_table.y 
> FROM some_table 
> WHERE some_table.id = ? UNION SELECT DISTINCT some_table.id, 
> some_table.x, some_table.y 
> FROM some_table 
> WHERE some_table.id = ? ORDER BY id 
>  LIMIT ? OFFSET ? 
>
> that's standard SQL that all current tested databases can handle, yes. 
>If MonetDB cannot, there can be a requirements rule to establish 
> this or you can have these tests skipped by overriding them in your 
> own test suite per the technique shown in README.dialects.rst. 
>

You are right, this just works. I was confused and mixed up errors. Sorry 
for the noise.

greetings,

 - Gijs 

-- 
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 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] question about test_integrity_error test

2017-10-19 Thread Gijs Molenaar


Op donderdag 19 oktober 2017 03:18:46 UTC+2 schreef Mike Bayer:
>
> On Wed, Oct 18, 2017 at 9:23 AM, Gijs Molenaar <gijsmo...@gmail.com 
> > wrote: 
> > hi! 
> > 
> > I'm trying to understand the intentions of this test better: 
> > 
> > 
> https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/testing/suite/test_dialect.py#L30
>  
> > 
> > The test checks if a integrity error is raised when a duplicate key is 
> > inserted. In the case of the MonetDB dialect this exception is raised. 
> But 
> > then the test still fails. This is because the context manager initiated 
> by 
> > 'with config.db.begin() ' tries to commit the transaction when exiting 
> the 
> > context. This fails, which I guess is correct. Isn't there a mistake in 
> the 
> > test? 
>
> so the only database I deal with that is strict about this is 
> Postgresql, which even in the FAQ includes an example of how to 
> generate the "current transaction is aborted, commands ignored until 
> end of transaction block" error.   It is not generating that here, but 
> if I do this, then it does: 
>
> diff --git a/lib/sqlalchemy/testing/suite/test_dialect.py 
> b/lib/sqlalchemy/testing/suite/test_dialect.py 
> index 5dd1f0501..eef4c4a71 100644 
> --- a/lib/sqlalchemy/testing/suite/test_dialect.py 
> +++ b/lib/sqlalchemy/testing/suite/test_dialect.py 
> @@ -42,6 +42,10 @@ class ExceptionTest(fixtures.TablesTest): 
>  {'id': 1, 'data': 'd1'} 
>  ) 
>
> +conn.execute( 
> +self.tables.manual_pk.insert(), 
> +{'id': 2, 'data': 'd1'} 
> +) 
>
>  class AutocommitTest(fixtures.TablesTest): 
>
>
> so yes that's a bug.   An unticketed fix is in the pipeline at 
> https://gerrit.sqlalchemy.org/576. 
>
>
>
Ok, thanks! 

-- 
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 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] sqlalchemy.select().group_by(expr) doesn't use label of expression, while .order_by(expr) does

2017-10-19 Thread Gijs Molenaar


Op donderdag 19 oktober 2017 03:10:21 UTC+2 schreef Mike Bayer:
>
> On Wed, Oct 18, 2017 at 7:38 AM, Gijs Molenaar <gijsmo...@gmail.com 
> > wrote: 
> > hi! 
> > 
> > 
> > Not sure if this a bug or something I should in my SQLAlchemy dialect, 
> but 
> > currently 
> > 
> > 
> > expr = (table.c.x + table.c.y).label('lx') 
> > select([func.count(table.c.id), expr]).group_by(expr).order_by(expr) 
> > 
> > compiles to: 
> > 
> > SELECT count(some_table.id) AS count_1, some_table.x + some_table.y AS 
> lx 
> > \nFROM some_table GROUP BY some_table.x + some_table.y ORDER BY lx; 
> > 
> > 
> > which works fine for for example sqlite, but MonetDB requires the use of 
> the 
> > lx label in the GROUP BY, which I think makes sense? Should this be 
> > addressed on the SQLalchemy side or on the MonetDB dialect side? 
>
> so this was overhauled in 
>
> http://docs.sqlalchemy.org/en/latest/changelog/migration_09.html#label-constructs-can-now-render-as-their-name-alone-in-an-order-by
>  
> where we changed ORDER BY to use the label name when the expression is 
> passed. 
>
> so the immediate answer would be to not actually order by the label(). 
>

I think i didn't formulate my e-mail correctly. The ORDER BY is not the 
problem, it is the GROUP BY that requires a label. If the GROUP BY doesn't 
use a label (just like ORDER BY), MonetDB doesn't want to eat the query. 


> At the compiler level, this behavior can be disabled across the board like 
> this: 
>
> diff --git a/lib/sqlalchemy/dialects/sqlite/base.py 
> b/lib/sqlalchemy/dialects/sqlite/base.py 
> index d8ce7f394..389d9bb02 100644 
> --- a/lib/sqlalchemy/dialects/sqlite/base.py 
> +++ b/lib/sqlalchemy/dialects/sqlite/base.py 
> @@ -800,6 +800,10 @@ class SQLiteCompiler(compiler.SQLCompiler): 
>  'week': '%W', 
>  }) 
>
> +def visit_label(self, elem, **kw): 
> +kw.pop('render_label_as_label', None) 
> +return super(SQLiteCompiler, self).visit_label(elem, **kw) 
> + 
>  def visit_now_func(self, fn, **kw): 
>  return "CURRENT_TIMESTAMP" 
>
>
>
> however no dialect does that right now, you'd need to watch this 
> behavior closely across SQLAlchemy releases to make sure it doesn't 
> break, unless we make this behavior official. 
>
>
>
>
> > 
> > 
> > related issue: 
> > 
> > 
> > https://github.com/gijzelaerr/sqlalchemy-monetdb/issues/21 
> > 
> > greetings, 
> > 
> >  - Gijs 
> > 
> > -- 
> > 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+...@googlegroups.com . 
> > To post to this group, send email to sqlal...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sqlalchemy. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 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.


[sqlalchemy] missing select() in CompoundSelectTest ?

2017-10-18 Thread Gijs Molenaar
Hi again!

This is the hopefully the last mail since this is the last failing test for 
the MonetDB dialect!

I noticed that some tests in the CompoundSelectTest class do a select() on 
the union:

https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/testing/suite/test_select.py#L298

While others don't, for example:

https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/testing/suite/test_select.py#L283

MonetDB is having a bit of problems processing unions without a enclosing 
select statement.

So question again is, is this a mistake in the test, or should the MonetDB 
dialect be smart enough to handle this?

related issues:

https://github.com/gijzelaerr/sqlalchemy-monetdb/issues/16
https://github.com/gijzelaerr/sqlalchemy-monetdb/issues/15

-- 
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 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] problems running test suite for dialect

2017-09-12 Thread Gijs Molenaar


Op dinsdag 12 september 2017 15:46:30 UTC+2 schreef Mike Bayer:
>
> On Tue, Sep 12, 2017 at 6:38 AM, Gijs Molenaar <gijsmo...@gmail.com 
> > wrote: 
> > Hi again! 
> > 
> > I switched to the new style test running, but now I seem to be unable to 
> set 
> > the requirements file (see below). I noticed changing the 
> requirement_cls in 
> > the sqla_testing section in setup.cfg doesn't have any affect. Do you 
> have a 
> > suggestion about what I am missing? 
>
> I would recommend getting py.test to work first from the py.test 
> command itself.   For setup.py to work, you need to build a special 
> PyTest command inside of setup.py, they now recommend an extension as: 
>
> https://docs.pytest.org/en/latest/goodpractices.html#integrating-with-setuptools-python-setup-py-test-pytest-runner
>  
>   however SQLA is using: 
> https://docs.pytest.org/en/latest/goodpractices.html#manual-integration 
>
> perfect, that worked! Thanks!

 

-- 
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 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] problems running test suite for dialect

2017-09-12 Thread Gijs Molenaar
Ah! I think i solved it, when I just run py.test it works, but python 
setup.py test doesn't. Can't figure out why, but i will just use the 
py.test runner.

greetings,

 - Gijs

Op dinsdag 12 september 2017 12:38:00 UTC+2 schreef Gijs Molenaar:
>
> Hi again!
>
> I switched to the new style test running, but now I seem to be unable to 
> set the requirements file (see below). I noticed changing the 
> requirement_cls in the sqla_testing section in setup.cfg doesn't have any 
> affect. Do you have a suggestion about what I am missing?
>
> greetings,
>
>  - Gijs
>
>
> $ python2 setup.py test
> running test
> [...]
> running build_ext
> Traceback (most recent call last):
>   File "/Users/gijs/Work/sqlalchemy-monetdb/setup.py", line 49, in 
> 
> setup(**setup_params)
>   File 
> "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py"
> , line 151, in setup
> dist.run_commands()
>   File 
> "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py"
> , line 953, in run_commands
> self.run_command(cmd)
>   File 
> "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py"
> , line 972, in run_command
> cmd_obj.run()
>   File 
> "/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/setuptools/command/test.py"
> , line 215, in run
> self.run_tests()
>   File 
> "/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/setuptools/command/test.py"
> , line 238, in run_tests
> **exit_kwarg
>   File 
> "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py"
> , line 94, in __init__
> self.parseArgs(argv)
>   File 
> "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py"
> , line 149, in parseArgs
> self.createTests()
>   File 
> "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py"
> , line 158, in createTests
> self.module)
>   File 
> "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py"
> , line 130, in loadTestsFromNames
> suites = [self.loadTestsFromName(name, module) for name in names]
>   File 
> "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py"
> , line 91, in loadTestsFromName
> module = __import__('.'.join(parts_copy))
>   File "/Users/gijs/Work/sqlalchemy-monetdb/test/test_suite.py", line 2, 
> in 
> from sqlalchemy.testing.suite import *
>   File 
> "/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/sqlalchemy/testing/suite/__init__.py"
> , line 2, in 
> from sqlalchemy.testing.suite.test_dialect import *
>   File 
> "/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_dialect.py"
> , line 9, in 
> class ExceptionTest(fixtures.TablesTest):
>   File 
> "/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_dialect.py"
> , line 27, in ExceptionTest
> @requirements.duplicate_key_raises_integrity_error
> AttributeError: 'NoneType' object has no attribute 
> 'duplicate_key_raises_integrity_error'
>
>
>
>>

-- 
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 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] problems running test suite for dialect

2017-09-12 Thread Gijs Molenaar
Hi again!

I switched to the new style test running, but now I seem to be unable to 
set the requirements file (see below). I noticed changing the 
requirement_cls in the sqla_testing section in setup.cfg doesn't have any 
affect. Do you have a suggestion about what I am missing?

greetings,

 - Gijs


$ python2 setup.py test
running test
[...]
running build_ext
Traceback (most recent call last):
  File "/Users/gijs/Work/sqlalchemy-monetdb/setup.py", line 49, in 
setup(**setup_params)
  File 
"/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py"
, line 151, in setup
dist.run_commands()
  File 
"/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py"
, line 953, in run_commands
self.run_command(cmd)
  File 
"/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py"
, line 972, in run_command
cmd_obj.run()
  File 
"/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/setuptools/command/test.py"
, line 215, in run
self.run_tests()
  File 
"/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/setuptools/command/test.py"
, line 238, in run_tests
**exit_kwarg
  File 
"/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py"
, line 94, in __init__
self.parseArgs(argv)
  File 
"/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py"
, line 149, in parseArgs
self.createTests()
  File 
"/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py"
, line 158, in createTests
self.module)
  File 
"/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py"
, line 130, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
  File 
"/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py"
, line 91, in loadTestsFromName
module = __import__('.'.join(parts_copy))
  File "/Users/gijs/Work/sqlalchemy-monetdb/test/test_suite.py", line 2, in 

from sqlalchemy.testing.suite import *
  File 
"/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/sqlalchemy/testing/suite/__init__.py"
, line 2, in 
from sqlalchemy.testing.suite.test_dialect import *
  File 
"/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_dialect.py"
, line 9, in 
class ExceptionTest(fixtures.TablesTest):
  File 
"/Users/gijs/Work/sqlalchemy-monetdb/.venv2/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_dialect.py"
, line 27, in ExceptionTest
@requirements.duplicate_key_raises_integrity_error
AttributeError: 'NoneType' object has no attribute 
'duplicate_key_raises_integrity_error'



>

-- 
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 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] problems running test suite for dialect

2017-09-07 Thread Gijs Molenaar
2017-09-06 15:45 GMT+02:00 Mike Bayer :

>
> OK, in the past couple of weeks I rewrote the README.unittests.rst and
> a bit of README.dialects.rst to reflect the current state of things.
>


Ah thanks! Going to have a look.

-- 
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 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.


[sqlalchemy] problems running test suite for dialect

2017-09-06 Thread Gijs Molenaar
Hi!

I'm working on improving the MonetDB dialect for SQLAlchemy.

https://github.com/gijzelaerr/sqlalchemy-monetdb

Most of the work is done, but there are some tests failing. I'm running 
into some issues running the set suite though.

As described in the dialogs readme, I have a custom test script to run the 
tests. The issues I'm having is:

1> can't select a specfic test.

if I specify the test class, no tests are ran:



$ ./run_tests.py --tests test.test_suite.ComponentReflectionTest
[...]

Ran 0 tests in 0.261s

OK



If I specify a specif test I get an module error:


./run_tests.py --tests test.test_suite.ComponentReflectionTest.
test_get_temp_table_columns
E
[...]

ImportError: No module named test_get_temp_table_columns


2>  Failing test tacktrace is quite useless

==
ERROR: test.test_suite.ComponentReflectionTest.test_get_temp_table_columns
--
Traceback (most recent call last):
  File 
"/home/gijs/Work/sqlalchemy-monetdb/.venv2/local/lib/python2.7/site-packages/nose/case.py"
, line 197, in runTest
self.test(*self.arg)
  File "", line 2, in test_get_temp_table_columns
  File 
"/home/gijs/Work/sqlalchemy-monetdb/.venv2/local/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.py"
, line 95, in decorate
return self._do(config._current, fn, *args, **kw)
  File 
"/home/gijs/Work/sqlalchemy-monetdb/.venv2/local/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.py"
, line 124, in _do
self._expect_failure(cfg, ex, name=fn.__name__)
  File 
"/home/gijs/Work/sqlalchemy-monetdb/.venv2/local/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.py"
, line 136, in _expect_failure
util.raise_from_cause(ex)
  File 
"/home/gijs/Work/sqlalchemy-monetdb/.venv2/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py"
, line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File 
"/home/gijs/Work/sqlalchemy-monetdb/.venv2/local/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.py"
, line 122, in _do
return_value = fn(*args, **kw)
  File 
"/home/gijs/Work/sqlalchemy-monetdb/.venv2/local/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.py"
, line 364, in test_get_temp_table_columns
user_tmp = self.tables.user_tmp
  File 
"/home/gijs/Work/sqlalchemy-monetdb/.venv2/local/lib/python2.7/site-packages/sqlalchemy/testing/util.py"
, line 228, in __getattribute__
return dict.__getattribute__(self, key)
AttributeError: 'adict' object has no attribute 'user_tmp'

So the stacktrace shows me all the test code reraising the exception, but 
not where the actual problem is.

3> Can't set breakpoints using PyCharm

When I run the test runner, all breakpoints I set with PyCharm are ignored. 
Also I'm unsuccessful making the test suite work nicely with the integrated 
test runner in PyCharm. Any idea how to get this working?

thanks!

greetings,

 - Gijs

-- 
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 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.