awswrangler.dynamodb.read_partiql_query

awswrangler.dynamodb.read_partiql_query(query: str, parameters: list[Any] | None = None, chunked: bool = False, boto3_session: Session | None = None) DataFrame | Iterator[DataFrame]

Read data from a DynamoDB table via a PartiQL query.

Parameters:
  • query (str) – The PartiQL statement.

  • parameters (list[Any] | None) – The list of PartiQL parameters. These are applied to the statement in the order they are listed.

  • chunked (bool) – If True an iterable of DataFrames is returned. False by default.

  • boto3_session (Session | None) – The default boto3 session will be used if boto3_session is None.

Return type:

DataFrame | Iterator[DataFrame]

Returns:

Result as Pandas DataFrame.

Examples

Select all contents from a table

>>> import awswrangler as wr
>>> wr.dynamodb.read_partiql_query(
...     query="SELECT * FROM my_table WHERE title=? AND year=?",
...     parameters=[title, year],
... )

Select specific columns from a table

>>> wr.dynamodb.read_partiql_query(
...     query="SELECT id FROM table"
... )