Code Monkey home page Code Monkey logo

pydynamodb's People

Contributors

passren avatar qqq-33 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kapilt qqq-33

pydynamodb's Issues

WHERE clauses are not pushed down to PartiQL?

Thank you for making this library!

If I issue:

SELECT * FROM "cache" WHERE "my-value" != ''

to both boto3 directly (pure PartiQL) and to pydynamodb, pydynamodb never returns (the table is large).

I see that the statement it pushes down is SELECT * FROM "cache".

I am guessing it is eagerly pre-fetching data and locally evaluating the WHERE.

I would expect the entire SELECT statement to be pushed down as it is to PartiQL, which is able to handle this.

How to SELECT a field in a DynamoDB map item?

This works in the DynamoDB PartiQL editor:

SELECT payload."size"
FROM "table"
WHERE pk='foo'

But when I do:

cursor.execute('SELECT payload."size" FROM "table" WHERE pk='foo')

I get this error:

dynamodb error: An error occurred (ValidationException) when calling the ExecuteStatement operation: Statement wasn't well formed, can't be processed: Invalid path dot component

An example of what my data looks like:

[
  {
    'pk': foo',
    'payload': {'size': 2, 'bla': 'bla'},
  },
  {
    'pk': 'bar',
    'payload': {'size': 2, 'bla': 'bla'},
  }
]

How may I go about selecting size from payload?

Note that I intend to use DynamoDB in Apache Superset. Was getting the same error there in the SQL Lab section. Digging around their repo led me here. Installed the package and ran the same query to confirm it wasn't a Superset thing.

Statement wasn't well formed, can't be processed: Unexpected keyword

Hi there,

I'm using pydynamodb with sqlalchemy in order to convert a simple app which previously used sqlite.

I made the change to the connection string, and I see that pynamodb can connect using my credentials to the dynamodb table.
But when inserting a record I get the error below:

sqlalchemy.exc.OperationalError: (pydynamodb.error.OperationalError) An error occurred (ValidationException) when calling the ExecuteStatement operation: Statement wasn't well formed, can't be processed: Unexpected keyword
[SQL: INSERT INTO urls (key, secret_key, target_url, is_active, clicks) VALUES (?, ?, ?, ?, ?)]
[parameters: ('KSCBE', 'YMYXBEAP', 'http://globo.com', None, None)]
(Background on this error at: https://sqlalche.me/e/14/e3q8)

This is my database model:


class URL(Base):
    __tablename__ = "urls"

    id = Column(Integer, primary_key=True)
    key = Column(String)
    secret_key = Column(String)
    target_url = Column(String)
    is_active = Column(Boolean)
    clicks = Column(Integer)

Any advice?
Thanks in advance.

Add support for iam authentication

At present, connecting superset to DynamoDB via pyDynamoDB requires us to specify access_key and secret_key that adds to operational maintenance. It would be great if the driver can take iam credentials from the environment. This can be kept behind simple boolean flag similar to what pyathena or redshift-connector already provide. Thanks.

contains() or begins_with() don't work.

  1. contains() and begins_with() are not available in PartiQL [SELECT statements].

The syntax below is executable.
SELECT * FROM UserTB WHERE user_name = 'tes0125' Limit 2

contains() or begins_with() don't work. [SELECT statements]
SELECT * FROM UserTB WHERE user_name = 'tes0125' AND begins_with(range_key, 'FRIEND#') Limit 2

  1. Is there any way to handle paging?

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.