str, con: oracledb.Connection, schema: str | None = None, index_col: str | List[str] | None = None, params: List[Any] | Tuple[Any, ...] | Dict[Any, Any] | None = None, chunksize: int | None = None, dtype: Dict[str, DataType] | None = None, safe: bool = True, timestamp_as_object: bool = False) Any

Return a DataFrame corresponding the table.

  • table (str) – Table name.

  • con (oracledb.Connection) – Use oracledb.connect() to use credentials directly or to fetch it from the Glue Catalog.

  • schema (str, optional) – Name of SQL schema in database to query (if database flavor supports this). Uses default schema if None (default).

  • index_col (Union[str, List[str]], optional) – Column(s) to set as index(MultiIndex).

  • params (Union[List, Tuple, Dict], optional) – List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249’s paramstyle, is supported.

  • chunksize (int, optional) – If specified, return an iterator where chunksize is the number of rows to include in each chunk.

  • dtype (Dict[str, pyarrow.DataType], optional) – Specifying the datatype for columns. The keys should be the column names and the values should be the PyArrow types.

  • safe (bool) – Check for overflows or other unsafe data type conversions.

  • timestamp_as_object (bool) – Cast non-nanosecond timestamps (np.datetime64) to objects.


Result as Pandas DataFrame(s).

Return type:

Union[pandas.DataFrame, Iterator[pandas.DataFrame]]


Reading from Oracle Database using a Glue Catalog Connections

>>> import awswrangler as wr
>>> df =
...     table="my_table",
...     schema="test",
...     con=con
... )
>>> con.close()