Skip to content

Tmap

flowtask.components.tMap.tMap

tMap

tMap(loop=None, job=None, stat=None, **kwargs)

Bases: FlowComponent

tMap

Overview

The tMap class is a component for transforming and mapping data in a Pandas DataFrame. It supports various column name
transformations, data type conversions, and function applications to columns. It extends the FlowComponent class and
provides methods for column information retrieval, data transformation, and function execution.

.. table:: Properties :widths: auto

+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| Name             | Required | Description                                                                                      |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| tablename        |   No     | The name of the table to retrieve column information from.                                       |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| schema           |   No     | The schema of the table to retrieve column information from.                                     |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| model            |   No     | The model to use for data transformation.                                                        |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| _modelinfo       |   No     | A dictionary containing the model information.                                                   |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| map              |   No     | The map file to use for column transformations.                                                  |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| _mapping         |   No     | A dictionary containing the column mappings.                                                     |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| force_map        |   No     | A flag indicating if the map file should be forced, defaults to False.                           |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| replace_columns  |   No     | A flag indicating if columns should be replaced, defaults to True.                               |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| drop_missing     |   No     | A flag indicating if missing columns should be dropped, defaults to False.                       |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
|  column_info     |   Yes    | I access the information of the column through a statement in sql to extract the data            |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
|  clean_names     |   Yes    | Remove duplicate names from data                                                                 |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+

Return

The methods in this class manage the transformation and mapping of data in a Pandas DataFrame, including initialization,
column information retrieval, data transformation, and function execution.



Example:

```yaml
tMap:
  schema: bose
  map: products_by_store
  drop_missing: false
```

close async

close()

close.

close method

run async

run()

run.

Iteration over all dataframes.