updated pymysql to version 0.6.1 and it worked for me. thx alot

2014-02-12 19:27 GMT+02:00 Michael Bayer <mike...@zzzcomputing.com>:

> And you updated pymysql?  Or no?
>
> Sent from my iPhone
>
> On Feb 12, 2014, at 10:56 AM, Igal Kreimer <igal.k...@gmail.com> wrote:
>
> yes it does. exactly the same problem, copy pasted ur code and received:
>
>   File
> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\query.py",
> line 2264, in all
>   File
> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\loading.py",
> line 75, in instances
>   File
> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\loading.py",
> line 75, in <listcomp>
>   File
> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\loading.py",
> line 74, in <listcomp>
>   File
> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\query.py",
> line 3440, in proc
>   File
> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\engine\result.py",
> line 71, in __getitem__
>   File
> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\engine\result.py",
> line 317, in _key_fallback
> sqlalchemy.exc.NoSuchColumnError: "Could not locate column in row for
> column 'a.id'"
>
>
> 2014-02-12 16:26 GMT+02:00 Michael Bayer <mike...@zzzcomputing.com>:
>
>>
>> On Feb 12, 2014, at 4:49 AM, Igal Kreimer <igal.k...@gmail.com> wrote:
>>
>> > Hello sqlalchemy team.
>> >
>> > im a new user to the alchemy, and doing the tutorial on ur site.
>> > ran ur tutorial on adding information to databases and querying against
>> a virtual db (sqlite in memory)
>> >
>> > after i thought i got that, i tried testing against a real db - mysql
>> db.
>> > im using the driver of pymysql version 0.4 (i know its kinda old, but
>> when was using newer version i had other bugs, not related to this topic).
>>
>> OK well definitely get on the latest pymysql, that driver is not super
>> mature so you want to be on the latest.   I tried 0.6.1 here and can't
>> reproduce your issue.
>>
>>
>> >
>> > Traceback (most recent call last):
>> >   File "J:/working_dir/TLM/lib/DB_Wrapper/Lab_DB/DB_Reader.py", line
>> 39, in <module>
>> >     read_from_DB()
>> >   File "J:/working_dir/TLM/lib/DB_Wrapper/Lab_DB/DB_Reader.py", line
>> 26, in read_from_DB
>> >     print(str(session.query(CpuTable.id.label('id')).all()))
>> >   File
>> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\query.py",
>> line 2264, in all
>> >   File
>> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\loading.py",
>> line 75, in instances
>> >   File
>> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\loading.py",
>> line 75, in <listcomp>
>> >   File
>> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\loading.py",
>> line 74, in <listcomp>
>> >   File
>> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\orm\query.py",
>> line 3440, in proc
>> >   File
>> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\engine\result.py",
>> line 71, in __getitem__
>> >   File
>> "C:\Python33\lib\site-packages\sqlalchemy-0.9.0-py3.3.egg\sqlalchemy\engine\result.py",
>> line 317, in _key_fallback
>> > sqlalchemy.exc.NoSuchColumnError: "Could not locate column in row for
>> column 'cpu.id'"
>>
>> yes that's a totally strange issue that I cannot reproduce, running SQLA
>> 0.9.0 / py3.3 / pymysql.
>>
>> one thing that *may* be going wrong is that I see you're on windows, and
>> there might be case sensitivity issues happening.  Though I'm not really
>> sure how, I can use any name for the label and of course it works.
>>
>> here's the test case I'm using, you get the same results with this?
>>
>> from sqlalchemy import *
>> from sqlalchemy.orm import *
>> from sqlalchemy.ext.declarative import declarative_base
>>
>> Base = declarative_base()
>>
>> class A(Base):
>>     __tablename__ = 'a'
>>
>>     id = Column(Integer, primary_key=True)
>>
>> e = create_engine("mysql+pymysql://scott:tiger@localhost/test",
>> echo=True)
>> Base.metadata.drop_all(e)
>> Base.metadata.create_all(e)
>>
>> sess = Session(e)
>> sess.add_all([A(), A(), A()])
>>
>> print(sess.query(A.id.label('id')).all())
>> print(sess.query(A.id.label('foobar')).all())
>>
>>
>>
>>
>  --
> 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/groups/opt_out.
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "sqlalchemy" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sqlalchemy/Csp5gF0NBxw/unsubscribe.
> To unsubscribe from this group and all its topics, 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/groups/opt_out.
>

-- 
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/groups/opt_out.

Reply via email to