Giter Club home page Giter Club logo

Comments (6)

graingert avatar graingert commented on July 22, 2024

Do you have an example?

from sqlalchemy-redshift.

briandailey avatar briandailey commented on July 22, 2024
unload = UnloadFromSelect(select([sa.func.count(1)]).limit(1), ...s3params...)
print unload.compile().params

Note that in the select param you'll get something like this:

'select': u'SELECT count(1) AS count_1\n LIMIT :param_1'

:param_1 is included in the SQL statement and throws an error.

from sqlalchemy-redshift.

briandailey avatar briandailey commented on July 22, 2024

FWIW, the behavior of the old redshift-sqlalchemy package was that the limit parameter was passed to the unload command as a param, e.g. you would get:

unload.compile().params                                                             
{u'param_1': 5000000}

from sqlalchemy-redshift.

briandailey avatar briandailey commented on July 22, 2024

Looks like this is an issue with older versions of sqlalchemy - may be able to resolve by upgrading it.
This issue on sqlalchemy goes into more detail.

from sqlalchemy-redshift.

graingert avatar graingert commented on July 22, 2024

I don't want to peg everyone to sqlalchemy >= 1.0 perhaps this would be better with an assert on the sqlalchemy version if the statement has a ._limit attribute?

from sqlalchemy-redshift.

briandailey avatar briandailey commented on July 22, 2024

That is a great idea - raise an exception to let the user know that they need to upgrade SQLAlchemy.

from sqlalchemy-redshift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.