Skip to content

Commit aca02ac

Browse files
committed
add transformation_dict
1 parent 035d38e commit aca02ac

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

models.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pandas as pd
22

33
# Lists of Possible entities
4-
data_transformations = ['Join', 'Union']
4+
55
join_types = ['left', 'right', 'outer', 'inner']
66

77

@@ -21,4 +21,5 @@ def __init__(self, table, type='user_table'):
2121
'B': ['B0', 'B1', 'B2'],
2222
'id': ['K0', 'K1', 'K3']
2323
}))
24-
}
24+
}
25+

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ pandas
22
numpy
33
fuzzywuzzy
44
python-Levenshtein
5-
nltk
5+
nltk
6+
sklearn

transformation_functions.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,18 @@ def join(table_a, table_b):
2424
matched_keys_right = nlp_join_keys_right.get_matches(table_b_columns, threshold=90)
2525

2626

27-
joined_table = pd.merge(table_a, table_b, how=TypeofJoin, left_on=matched_keys_left, right_on=matched_keys_right)
27+
joined_table = pd.merge(table_a.table, table_b.table, how=TypeofJoin, left_on=matched_keys_left, right_on=matched_keys_right)
2828
return joined_table
2929

3030

31+
def union(table_a, table_b):
32+
pass
33+
34+
transformations_dict = {
35+
'join' : join,
36+
'union': union
37+
}
38+
3139
# --------------------- for debugging ----------------------------------
3240

3341
if __name__ == '__main__':

0 commit comments

Comments
 (0)