Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-19 Thread su-sa
Hi Simon, you are absolutely correct, I just thought may be its something so obvious that some experienced people immediately see. I am sorry about not being in a position to put enough data. But luckily, I found out that the problem was only this that I was writing a parameter in the wrong

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
@Mike, Jonathan and Simon - Thank you so much for all your efforts. I hope I can fix the problem soon in the dialect :-) P.s. I have finally been able to generate the correct query, but now currently the problem is that I get no result, although the query is absolutely correct and should give

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
Hi, Thanks for your time, probably you are all right. Greetings, Sugandha -- 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

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
Hi, Thanks a lot for your time, I have been work on and with that dialect for sometime, but probably you are all correct. Greetings, Sugandha -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE:

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
q2 = session.query(Supplier.s_acctbal, Supplier.s_name, Nation.n_name, Part.p_partkey, Part.p_mfgr, Supplier.s_address, Supplier.s_phone, Supplier.s_comment).filter(Part.p_partkey == Partsupp.ps_partkey, Supplier.s_suppkey== Partsupp.ps_suppkey,

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
I am not sure what you mean exactly, am I applying the .correlate at the wrong place ? Thats the query I am trying to reproduce. select top 100 s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment from sf10.c_part, sf10.c_supplier,

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
Hi Simon, I am executing q2 on its own, may be I shouldnt have mentioned correlate, but if I dont mention it I get another error: sqlalchemy.exc.InvalidRequestError: Select statement 'SELECT min(partsupp.ps_supplycost) AS min_1 FROM partsupp, part, supplier, nation, region WHERE

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
But if I am not mistaken, the from clause of the query is generated by SQLAlchemy and the database driver or the dialect has no influence on this from clause generation of SQLAlchemy. And as you can see, the wrong from clause in generated in the subquery: AS min_1 \nFROM part \nWHERE

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
Hi Mike, 'hdbcli' is the official python driver for SAP HANA and you are right that it is not open-source. I also tried with pyhdb: q2 = session.query(Supplier.s_acctbal, Supplier.s_name, Nation.n_name, Part.p_partkey, Part.p_mfgr, Supplier.s_address, Supplier.s_phone,

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
Hi Mike, 'hdbcli' is the official python driver and you are right that it is not open-source. I also tried with pyhdb: q2 = session.query(Supplier.s_acctbal, Supplier.s_name, Nation.n_name, Part.p_partkey, Part.p_mfgr, Supplier.s_address, Supplier.s_phone,

Re: [sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
this error at: http://sqlalche.me/e/4xp6) Do you may be know what the reason could be? Can there be some error in my query building using SQLAlchemy? Thanks and Best Regards, Sugandha On Wed, Apr 18, 2018 at 6:34 AM, su-sa <sachdeva@gmail.com > > wrote: > > > > &

[sqlalchemy] Re: unable to do nested select while using query object

2018-04-18 Thread su-sa
On Wednesday, 18 April 2018 12:18:51 UTC+2, su-sa wrote: > > > > Hi everyone, > > I've been trying quite a while to reproduce the following query:q2 = text( > "select top 100 s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, > s_phon

[sqlalchemy] unable to do nested select while using query object

2018-04-18 Thread su-sa
Hi everyone, I've been trying quite a while to reproduce the following query:q2 = text( "select top 100 s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment from system.part, " "system.supplier, system.partsupp, system.nation, system.region where p_partkey =

[sqlalchemy] Re: Is there any way do select top 100 results from a query in SQLAlchemy?

2018-04-18 Thread su-sa
On Tuesday, 17 April 2018 23:59:25 UTC+2, Jonathan Vanasco wrote: > > > > On Tuesday, April 17, 2018 at 5:58:32 PM UTC-4, Jonathan Vanasco wrote: >> >> >> So .limit() is .top() >> > > Clarified: `limit()` is essentially the same as if there were a `top()`, > because it will emit `TOP` for the

[sqlalchemy] Re: Is there any way do select top 100 results from a query in SQLAlchemy?

2018-04-17 Thread su-sa
On Tuesday, 17 April 2018 23:17:27 UTC+2, su-sa wrote: > > Hi everyone! > > I am trying to build the following query with SQLAlchemy: > > "select top 100 s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, > s_phone, s_comment from system.part, " >

[sqlalchemy] Is there any way do select top 100 results from a query in SQLAlchemy?

2018-04-17 Thread su-sa
Hi everyone! I am trying to build the following query with SQLAlchemy: "select top 100 s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment from system.part, " "system.supplier, system.partsupp, system.nation, system.region where p_partkey = ps_partkey " "and

Re: [sqlalchemy] running py.test

2018-02-13 Thread su-sa
Hi Simon, I installed both pytest and mock using pip install py.test mock in the virtualenv. I am using anaconda python. Both the libraries are surely installed. On Friday, 9 February 2018 12:36:26 UTC+1, Simon King wrote: > On Wed, Feb 7, 2018 at 2:23 PM, su-sa <sachdeva@gma

[sqlalchemy] running py.test

2018-02-07 Thread su-sa
Hallo everyone, I am trying to run all the pytest of sqlalchemy. But I always get the error - SQLAlchemy requires Mock as of version 0.8.2. I already have the mock library installed. Could somebody please help me to solve the problem. Thanks in advance, Greetings, S -- SQLAlchemy - The

[sqlalchemy] Re: Influencing what CREATE statement generated in sqlalchemy

2017-12-01 Thread su-sa
Thanks a lot Mike! On Thursday, 30 November 2017 11:32:05 UTC+1, su-sa wrote: > > Hi everyone, > > does someone maybe know if one can from the dialect somehow influence what > CREATE TABLE statement would be generated in certain cases? > > So for example: In the tests for

[sqlalchemy] Influencing what CREATE statement generated in sqlalchemy

2017-11-30 Thread su-sa
Hi everyone, does someone maybe know if one can from the dialect somehow influence what CREATE TABLE statement would be generated in certain cases? So for example: In the tests for temporary table I saw that for Oracle, the create table statement has been adjusted, but that only ís a hack to

[sqlalchemy] sqlalchemy ComponentReflectionTests show errors

2017-11-03 Thread su-sa
Hi everyone, I am testing hana with sqlalchemy and the all the ComponentReflectionTests show an error. The traceback for test_varchar_reflection is as follows: ERROR at setup of ComponentReflectionTest_hana+hdbcli.test_varchar_reflection Traceback (most recent call last): File

Re: [sqlalchemy] Different results if the tests are ran multiple number of times

2017-10-26 Thread su-sa
On Friday, 20 October 2017 19:34:25 UTC+2, Mike Bayer wrote: > On Fri, Oct 20, 2017 at 9:27 AM, su-sa <sachdeva@gmail.com > > wrote: > > I am trying to test sqlalchemy with an external dialect. To do the Tests > > with the requirements specified by this

[sqlalchemy] Some sqlalchemy unittests running twice while testing with an external dialect

2017-10-20 Thread su-sa
I ran the unittests of SQLAlchemy with an external dialect and observed that some Tests can 2 times and also had different results. Does somebody know what the reason behing it could be ? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post

[sqlalchemy] Different results if the tests are ran multiple number of times

2017-10-20 Thread su-sa
I am trying to test sqlalchemy with an external dialect. To do the Tests with the requirements specified by this external dialect, I used the --requirements Parameter. The Test results of some Tests varied when I ran the Tests multiple number of times. I am´doing the testing currently on the