|
1 | 1 | import pandas as pd
|
2 | 2 | import featuretools as ft
|
3 | 3 |
|
4 |
| -from featuretools.variable_types import ZIPCode |
| 4 | +from featuretools.variable_types import ZIPCode, Index, Datetime, Numeric, DatetimeTimeIndex, Categorical, Id |
5 | 5 | from pandas.util.testing import assert_frame_equal
|
6 | 6 |
|
7 | 7 | from autonormalize import classes, normalize, autonormalize
|
@@ -194,4 +194,22 @@ def test_variable_types():
|
194 | 194 | variable_types={"zip_code": ZIPCode})
|
195 | 195 |
|
196 | 196 | normalized_entityset = autonormalize.normalize_entity(entityset)
|
| 197 | + |
| 198 | + assert normalized_entityset['transaction_id'].variable_types['transaction_id'] == Index |
| 199 | + assert normalized_entityset['transaction_id'].variable_types['session_id'] == Id |
| 200 | + assert normalized_entityset['transaction_id'].variable_types['transaction_time'] == DatetimeTimeIndex |
| 201 | + assert normalized_entityset['transaction_id'].variable_types['product_id'] == Id |
| 202 | + assert normalized_entityset['transaction_id'].variable_types['amount'] == Numeric |
| 203 | + |
| 204 | + assert normalized_entityset['product_id'].variable_types['product_id'] == Index |
| 205 | + assert normalized_entityset['product_id'].variable_types['brand'] == Categorical |
| 206 | + |
| 207 | + assert normalized_entityset['session_id'].variable_types['session_id'] == Index |
| 208 | + assert normalized_entityset['session_id'].variable_types['customer_id'] == Id |
| 209 | + assert normalized_entityset['session_id'].variable_types['device'] == Categorical |
| 210 | + assert normalized_entityset['session_id'].variable_types['session_start'] == Datetime |
| 211 | + |
| 212 | + assert normalized_entityset['customer_id'].variable_types['customer_id'] == Index |
| 213 | + assert normalized_entityset['customer_id'].variable_types['join_date'] == Datetime |
| 214 | + assert normalized_entityset['customer_id'].variable_types['date_of_birth'] == Datetime |
197 | 215 | assert normalized_entityset['customer_id'].variable_types['zip_code'] == ZIPCode
|
0 commit comments