awswrangler.catalog.get_table_types

awswrangler.catalog.get_table_types(database: str, table: str, boto3_session: Optional[boto3.session.Session] = None) → Dict[str, str]

Get all columns and types from a table.

Parameters
  • database (str) – Database name.

  • table (str) – Table name.

  • boto3_session (boto3.Session(), optional) – Boto3 Session. The default boto3 session will be used if boto3_session receive None.

Returns

A dictionary as {‘col name’: ‘col data type’}.

Return type

Dict[str, str]

Examples

>>> import awswrangler as wr
>>> wr.catalog.get_table_types(database='default', name='my_table')
{'col0': 'int', 'col1': double}