Re: [sqlalchemy] sqlite problem with datetime format YYYY-MM-DDTHH:mm:ss

2015-09-03 Thread Massi
Thanks a lot!!

On Thursday, September 3, 2015 at 5:18:29 PM UTC+2, Simon King wrote:
>
> That's fine - the "regexp" argument is only used when interpreting the 
> data that comes back from sqlite - it doesn't depend on you actually 
> creating the table from SQLAlchemy. 
>
> It does require that you have an in-python "definition" of the table 
> structure, which I assume you already have, unless you are simply 
> using SQLAlchemy to issue raw SQL to sqlite. Do you have any table 
> definitions in your Python code, or are you using reflection? 
>
> If you are using reflection, you can override specific column 
> definitions as described at 
>
>
> http://docs.sqlalchemy.org/en/rel_1_0/core/reflection.html#overriding-reflected-columns
>  
>
> and 
>
>
> http://docs.sqlalchemy.org/en/rel_1_0/orm/extensions/declarative/table_config.html#using-reflection-with-declarative
>  
>
> Simon 
>
> On Thu, Sep 3, 2015 at 3:54 PM, Massi > 
> wrote: 
> > Hi Simone, 
> > 
> > thank you for your reply. Unfortunately I don't create the table so I 
> don't 
> > define the table, I only load it from the DB. I hope I intended your 
> > suggestion correctly. 
> > 
> > Thanks again. 
> > 
> > On Thursday, September 3, 2015 at 3:54:45 PM UTC+2, Simon King wrote: 
> >> 
> >> On Thu, Sep 3, 2015 at 1:05 PM, Massi  wrote: 
> >> > Hi everyone, 
> >> > 
> >> > I'm trying to use sqlalchemy (0.9.10) to read a sqlite table which 
> >> > contains 
> >> > some datetime columns. As the title says these column are given in 
> the 
> >> > format -MM-DDTHH:mm:ss (I did not create the table). When I 
> execute 
> >> > the 
> >> > query, it succeeds, but when I try to convert the rows to lists I get 
> >> > the 
> >> > following error: 
> >> > 
> >> > ValueError: Couldn't parse datetime string: u'1957-09-04T23:04:37' 
> >> > 
> >> > If I try to create a similar table via sqlalchemy and then to read 
> the 
> >> > data 
> >> > everything works fine. The data in this case is stored in the format 
> >> > -MM-DD HH:mm:ss. 
> >> > Any hint? 
> >> > 
> >> > Thanks in advance! 
> >> > 
> >> 
> >> You could try passing the regexp parameter to the DateTime column in 
> >> your table definition: 
> >> 
> >> 
> >> 
> http://docs.sqlalchemy.org/en/rel_1_0/dialects/sqlite.html#sqlalchemy.dialects.sqlite.DATETIME
>  
> >> 
> >> Hope that helps, 
> >> 
> >> Simon 
> > 
> > -- 
> > 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 http://groups.google.com/group/sqlalchemy. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] sqlite problem with datetime format YYYY-MM-DDTHH:mm:ss

2015-09-03 Thread Simon King
That's fine - the "regexp" argument is only used when interpreting the
data that comes back from sqlite - it doesn't depend on you actually
creating the table from SQLAlchemy.

It does require that you have an in-python "definition" of the table
structure, which I assume you already have, unless you are simply
using SQLAlchemy to issue raw SQL to sqlite. Do you have any table
definitions in your Python code, or are you using reflection?

If you are using reflection, you can override specific column
definitions as described at

http://docs.sqlalchemy.org/en/rel_1_0/core/reflection.html#overriding-reflected-columns

and

http://docs.sqlalchemy.org/en/rel_1_0/orm/extensions/declarative/table_config.html#using-reflection-with-declarative

Simon

On Thu, Sep 3, 2015 at 3:54 PM, Massi  wrote:
> Hi Simone,
>
> thank you for your reply. Unfortunately I don't create the table so I don't
> define the table, I only load it from the DB. I hope I intended your
> suggestion correctly.
>
> Thanks again.
>
> On Thursday, September 3, 2015 at 3:54:45 PM UTC+2, Simon King wrote:
>>
>> On Thu, Sep 3, 2015 at 1:05 PM, Massi  wrote:
>> > Hi everyone,
>> >
>> > I'm trying to use sqlalchemy (0.9.10) to read a sqlite table which
>> > contains
>> > some datetime columns. As the title says these column are given in the
>> > format -MM-DDTHH:mm:ss (I did not create the table). When I execute
>> > the
>> > query, it succeeds, but when I try to convert the rows to lists I get
>> > the
>> > following error:
>> >
>> > ValueError: Couldn't parse datetime string: u'1957-09-04T23:04:37'
>> >
>> > If I try to create a similar table via sqlalchemy and then to read the
>> > data
>> > everything works fine. The data in this case is stored in the format
>> > -MM-DD HH:mm:ss.
>> > Any hint?
>> >
>> > Thanks in advance!
>> >
>>
>> You could try passing the regexp parameter to the DateTime column in
>> your table definition:
>>
>>
>> http://docs.sqlalchemy.org/en/rel_1_0/dialects/sqlite.html#sqlalchemy.dialects.sqlite.DATETIME
>>
>> Hope that helps,
>>
>> Simon
>
> --
> 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 http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] sqlite problem with datetime format YYYY-MM-DDTHH:mm:ss

2015-09-03 Thread Massi
Hi Simone,

thank you for your reply. Unfortunately I don't create the table so I don't 
define the table, I only load it from the DB. I hope I intended your 
suggestion correctly.

Thanks again.

On Thursday, September 3, 2015 at 3:54:45 PM UTC+2, Simon King wrote:
>
> On Thu, Sep 3, 2015 at 1:05 PM, Massi > 
> wrote: 
> > Hi everyone, 
> > 
> > I'm trying to use sqlalchemy (0.9.10) to read a sqlite table which 
> contains 
> > some datetime columns. As the title says these column are given in the 
> > format -MM-DDTHH:mm:ss (I did not create the table). When I execute 
> the 
> > query, it succeeds, but when I try to convert the rows to lists I get 
> the 
> > following error: 
> > 
> > ValueError: Couldn't parse datetime string: u'1957-09-04T23:04:37' 
> > 
> > If I try to create a similar table via sqlalchemy and then to read the 
> data 
> > everything works fine. The data in this case is stored in the format 
> > -MM-DD HH:mm:ss. 
> > Any hint? 
> > 
> > Thanks in advance! 
> > 
>
> You could try passing the regexp parameter to the DateTime column in 
> your table definition: 
>
>
> http://docs.sqlalchemy.org/en/rel_1_0/dialects/sqlite.html#sqlalchemy.dialects.sqlite.DATETIME
>  
>
> Hope that helps, 
>
> Simon 
>

-- 
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Filter by first in relationship

2015-09-03 Thread Mike Bayer



On 9/3/15 10:13 AM, Mike Bayer wrote:



On 9/2/15 11:05 PM, Ryan Eberhardt wrote:

Hello,

I have User and Session classes like this:

class User(Base):
__tablename__ = 'users'

   id = Column(Integer, primary_key=True)
   sessions = relationship('Session')

   @property
def last_login_time(self):
return sorted(self.sessions, reverse=True, key=lambda x: 
x.time)[0]

...

class Session(Base):
__tablename__ = 'sessions'

id = Column(Integer, primary_key=True)
user_id = Column(Integer, ForeignKey('users.id'))
time = Column(DateTime)
...

The last_login_time property sorts the user's sessions by date and 
returns the most recent one. Now I want to query users using this 
property. I know I can use hybrid properties to do this, but I have 
no idea how to write the sql expression with sqlalchemy (i.e. I don't 
know how to get a user's most recent session using sqlalchemy 
expressions). Any ideas on how to do this?


when you want to sort by a related table in SQL you typically need to 
have a JOIN that is built externally to the attribute itself. A less 
efficient way is perhaps to use a correlated subquery and order by 
that, but that would be the only way to keep it self-contained:


@last_login_time.expression
def last_login_time(cls):
return select([max(Session.time)]).where(Session.user_id == 
cls.id).correlate(User).as_scalar()


ah crap.  func.max, sorry

return select([func.max(Session.time)]).where(Session.user_id == 
cls.id).correlate(User).as_scalar()









Thank you!
--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] SQLAlchemy-Continnum over 300 failed tests

2015-09-03 Thread Mike Bayer



On 9/3/15 10:12 AM, Piotr Dobrogost wrote:

On Thursday, September 3, 2015 at 3:58:42 PM UTC+2, Michael Bayer wrote:


well, I don't even know what SQLAlchemy-Continuum is.Is their
bugtracker open on github?


You must have forgotten then :) – 
https://groups.google.com/d/msg/sqlalchemy/BGWLUjaFtpY/ubLshcvHlKUJ
They have bug tracker on github 
(https://github.com/kvesteri/sqlalchemy-continuum/issues) but I have 
impression most projects do not welcome _questions_ on their trackers.
oh wow, well whether or not they welcome questions we sure get a crap 
ton of them, and especially if they have no mailing list, I'd not worry 
too deeply about that :).






Regards,
Piotr

--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Filter by first in relationship

2015-09-03 Thread Mike Bayer



On 9/2/15 11:05 PM, Ryan Eberhardt wrote:

Hello,

I have User and Session classes like this:

class User(Base):
__tablename__ = 'users'

   id = Column(Integer, primary_key=True)
   sessions = relationship('Session')

   @property
def last_login_time(self):
return sorted(self.sessions, reverse=True, key=lambda x: 
x.time)[0]

...

class Session(Base):
__tablename__ = 'sessions'

id = Column(Integer, primary_key=True)
user_id = Column(Integer, ForeignKey('users.id'))
time = Column(DateTime)
...

The last_login_time property sorts the user's sessions by date and 
returns the most recent one. Now I want to query users using this 
property. I know I can use hybrid properties to do this, but I have no 
idea how to write the sql expression with sqlalchemy (i.e. I don't 
know how to get a user's most recent session using sqlalchemy 
expressions). Any ideas on how to do this?


when you want to sort by a related table in SQL you typically need to 
have a JOIN that is built externally to the attribute itself.  A less 
efficient way is perhaps to use a correlated subquery and order by that, 
but that would be the only way to keep it self-contained:


@last_login_time.expression
def last_login_time(cls):
return select([max(Session.time)]).where(Session.user_id == 
cls.id).correlate(User).as_scalar()






Thank you!
--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] SQLAlchemy-Continnum over 300 failed tests

2015-09-03 Thread Piotr Dobrogost
On Thursday, September 3, 2015 at 3:58:42 PM UTC+2, Michael Bayer wrote:
>
>
> well, I don't even know what SQLAlchemy-Continuum is.Is their 
> bugtracker open on github?
>

You must have forgotten then :) – 
https://groups.google.com/d/msg/sqlalchemy/BGWLUjaFtpY/ubLshcvHlKUJ
They have bug tracker on github 
(https://github.com/kvesteri/sqlalchemy-continuum/issues) but I have 
impression most projects do not welcome _questions_ on their trackers.

Regards,
Piotr

-- 
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] create_engine with mysql://... database URI should use mysqlconnector as fallback driver

2015-09-03 Thread Mike Bayer



On 9/3/15 2:29 AM, scls wrote:

Hello,

I'm using MySQL connector Python as MySQL driver for Python.

import sqlalchemy
import pandas as pd
import numpy as np

db_uri = 'mysql+mysqlconnector://root:root@localhost:3306/test'
engine = sqlalchemy.create_engine(db_uri)
df = pd.DataFrame(np.random.randn(4,3), columns=['a','b','c'])
df.to_sql("df", engine)

works fine (a df table is create)

but

db_uri = 'mysql://root:root@localhost:3306/test'
engine = sqlalchemy.create_engine(db_uri)
df = pd.DataFrame(np.random.randn(4,3), columns=['a','b','c'])
df.to_sql("df", engine)
df.to_sql("test_table", engine)

raises

ImportError: No module named 'MySQLdb'

I'm using Mac OS X 10.10.5 and Anaconda Python 3.

I think that mysqlconnector should be use as a fallback driver.
we don't do "fallbacks" and ideally SQLAlchemy would never have even 
allowed a single "default" driver."fallbacks" would imply that we'd 
have a full pecking order of drivers available and that is neither 
something that is supportable nor something that would be helpful - the 
DBAPI drivers are not cross-compatible, even after SQLAlchemy has put 
them behind dialects there are still many areas in which they behave 
entirely differently.






Kind regards

--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] contains_eager bug

2015-09-03 Thread Mike Bayer



On 9/2/15 10:22 PM, Dave Vitek wrote:

On 9/2/2015 10:08 PM, Mike Bayer wrote:



On 9/2/15 9:57 PM, Dave Vitek wrote:

Answering my own question.

Here's a patch that seems to fix it, but I am uncertain about 
whether it breaks other things.  Use at your own risk, at least 
until someone more familiar with this code evaluates it.



this is a variant of a known issue, that of object X is being loaded 
in different contexts in the same row, with different loader 
strategies applied.  The first context that hits it wins.


I'm adding your test case to that issue at 
https://bitbucket.org/zzzeek/sqlalchemy/issues/3431/object-eager-loaded-on-scalar-relationship. 



the patch which is there seems to fix this test as well - it is 
extremely similar to your patch, so nice job!




I have a question about your patch.  If "existing" is None and is not 
present in dict_, it does not get placed into dict_.  I note that 
load_scalar_from_joined_new_row puts it into dict_ regardless of 
whether it is None.  Is this intentional/good?


it was intentional, as far as "good", that's part of why i didn't merge 
this in too quickly; I usually have to spend a few hours deeply 
re-familiarizing with sections like these before making assumptions.
the new/existing row thing has to do with the fact that the join returns 
for us the parent object multiple times.  the first time we see the 
parent, it's "new".  the subsequent times, it's "existing".  So here we 
are looking at a related item.  If we call _instance() and get None 
back, that means the columns for the related item were incomplete, e.g. 
primary key is incomplete / missing.  There shouldn't be a case where 
the row is None for "new" and non-None for "existing", but this is based 
on my not having re-familiarized with this section yet.












Index: lib/sqlalchemy/orm/strategies.py
===
--- lib/sqlalchemy/orm/strategies.py(revision 114304)
+++ lib/sqlalchemy/orm/strategies.py(working copy)
@@ -1474,20 +1474,24 @@
 def _create_scalar_loader(self, context, key, _instance):
 def load_scalar_from_joined_new_row(state, dict_, row):
 # set a scalar object instance directly on the parent
 # object, bypassing InstrumentedAttribute event handlers.
 dict_[key] = _instance(row, None)

 def load_scalar_from_joined_existing_row(state, dict_, row):
 # call _instance on the row, even though the object has
 # been created, so that we further descend into properties
 existing = _instance(row, None)
+if key in dict_:
+assert dict_[key] is existing
+else:
+dict_[key] = existing
 if existing is not None \
 and key in dict_ \
 and existing is not dict_[key]:
 util.warn(
 "Multiple rows returned with "
 "uselist=False for eagerly-loaded attribute '%s' "
 % self)

 def load_scalar_from_joined_exec(state, dict_, row):
 _instance(row, None)

- Dave

On 9/2/2015 7:29 PM, Dave Vitek wrote:

Hi all,

I've come across what I'm pretty sure is a bug with contains_eager 
when there are multiple joinpaths leading to the same row, and only 
some of those joinpaths are using contains_eager all they way down 
the joinpath.


I've prepared a test case:
http://pastebin.com/CbyUMdqC

See the text at the top of the test case for further details.

- Dave









--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] SQLAlchemy-Continnum over 300 failed tests

2015-09-03 Thread Mike Bayer



On 9/3/15 8:45 AM, Piotr Dobrogost wrote:

Hi!

As SQLAlchemy-Continuum extension does not appear to have its mailing 
list I thought I would ask here. If questions regarding sa-continuum 
are not welcomed here please accept my apologies (and tell me so).


well, I don't even know what SQLAlchemy-Continuum is.Is their 
bugtracker open on github?








I wanted to try out sa-continuum and I started by running tests with 
`py.test tests`. As a result 319 tests failed, 291 passed, 12 was 
skipped and 5 ended with an error. This is with SQLAlchemy-Continuum 
1.2.0, SQLAlchemy 1.0.8 and SQLAlchemy-Utils 0.30.17.


Are those failed tests result of me not running tests properly?
Output from py.test with the first 10 failures is 
at https://gist.github.com/piotr-dobrogost/4140267dc9dd654f5560



Regards,
Piotr Dobrogost
--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] sqlite problem with datetime format YYYY-MM-DDTHH:mm:ss

2015-09-03 Thread Simon King
On Thu, Sep 3, 2015 at 1:05 PM, Massi  wrote:
> Hi everyone,
>
> I'm trying to use sqlalchemy (0.9.10) to read a sqlite table which contains
> some datetime columns. As the title says these column are given in the
> format -MM-DDTHH:mm:ss (I did not create the table). When I execute the
> query, it succeeds, but when I try to convert the rows to lists I get the
> following error:
>
> ValueError: Couldn't parse datetime string: u'1957-09-04T23:04:37'
>
> If I try to create a similar table via sqlalchemy and then to read the data
> everything works fine. The data in this case is stored in the format
> -MM-DD HH:mm:ss.
> Any hint?
>
> Thanks in advance!
>

You could try passing the regexp parameter to the DateTime column in
your table definition:

http://docs.sqlalchemy.org/en/rel_1_0/dialects/sqlite.html#sqlalchemy.dialects.sqlite.DATETIME

Hope that helps,

Simon

-- 
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] SQLAlchemy-Continnum over 300 failed tests

2015-09-03 Thread Piotr Dobrogost
Hi!

As SQLAlchemy-Continuum extension does not appear to have its mailing list 
I thought I would ask here. If questions regarding sa-continuum are not 
welcomed here please accept my apologies (and tell me so).

I wanted to try out sa-continuum and I started by running tests with 
`py.test tests`. As a result 319 tests failed, 291 passed, 12 was skipped 
and 5 ended with an error. This is with SQLAlchemy-Continuum 1.2.0, 
SQLAlchemy 1.0.8 and SQLAlchemy-Utils 0.30.17.

Are those failed tests result of me not running tests properly?
Output from py.test with the first 10 failures is 
at https://gist.github.com/piotr-dobrogost/4140267dc9dd654f5560


Regards,
Piotr Dobrogost 

-- 
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] sqlite problem with datetime format YYYY-MM-DDTHH:mm:ss

2015-09-03 Thread Massi
Hi everyone,

I'm trying to use sqlalchemy (0.9.10) to read a sqlite table which contains 
some datetime columns. As the title says these column are given in the 
format -MM-DDTHH:mm:ss (I did not create the table). When I execute the 
query, it succeeds, but when I try to convert the rows to lists I get the 
following error:

ValueError: Couldn't parse datetime string: u'1957-09-04T23:04:37'

If I try to create a similar table via sqlalchemy and then to read the data 
everything works fine. The data in this case is stored in the format 
-MM-DD HH:mm:ss.
Any hint?

Thanks in advance!

-- 
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.