upgini 1.2.122a1__py3-none-any.whl → 1.2.122a2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
upgini/__about__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.122a1"
1
+ __version__ = "1.2.122a2"
upgini/autofe/feature.py CHANGED
@@ -145,6 +145,7 @@ class Feature:
145
145
  )
146
146
 
147
147
  def rename_columns(self, mapping: Dict[str, str]) -> "Feature":
148
+ self.op.rename_columns(mapping)
148
149
  for child in self.children:
149
150
  child.rename_columns(mapping)
150
151
  self.cached_display_name = None
upgini/autofe/operator.py CHANGED
@@ -89,6 +89,32 @@ class Operator(BaseModel, metaclass=OperatorRegistry):
89
89
  def delete_data(self):
90
90
  pass
91
91
 
92
+ def rename_columns(self, columns_renaming: Dict[str, str]) -> "Operator":
93
+ # Rename occurrences of column names inside self.params keys according to columns_renaming
94
+ if not self.params or not columns_renaming:
95
+ return self
96
+
97
+ # Replace longer keys first to avoid partial overlaps
98
+ replacements = sorted(columns_renaming.items(), key=lambda kv: -len(kv[0]))
99
+
100
+ renamed_params: Dict[str, str] = {}
101
+ for param_key, param_value in self.params.items():
102
+ new_key = param_key
103
+ for old, new in replacements:
104
+ if old and old in new_key:
105
+ new_key = new_key.replace(old, new)
106
+
107
+ if new_key in renamed_params and new_key != param_key:
108
+ self._logger.warning(
109
+ "Param key collision after rename: '%s' -> '%s'. Overwriting value.",
110
+ param_key,
111
+ new_key,
112
+ )
113
+ renamed_params[new_key] = param_value
114
+
115
+ self.params = renamed_params
116
+ return self
117
+
92
118
 
93
119
  class ParametrizedOperator(Operator, abc.ABC):
94
120
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: upgini
3
- Version: 1.2.122a1
3
+ Version: 1.2.122a2
4
4
  Summary: Intelligent data search & enrichment for Machine Learning
5
5
  Project-URL: Bug Reports, https://github.com/upgini/upgini/issues
6
6
  Project-URL: Homepage, https://upgini.com/
@@ -1,4 +1,4 @@
1
- upgini/__about__.py,sha256=hzzmPAt8OZIX5YRwSKl5dj9LWowWDEnOpFN5Xq2xARQ,26
1
+ upgini/__about__.py,sha256=s0uuov4eE8uySaKt-V4Lx3FlZDRMujpgzcGDSSewW1w,26
2
2
  upgini/__init__.py,sha256=LXSfTNU0HnlOkE69VCxkgIKDhWP-JFo_eBQ71OxTr5Y,261
3
3
  upgini/ads.py,sha256=nvuRxRx5MHDMgPr9SiU-fsqRdFaBv8p4_v1oqiysKpc,2714
4
4
  upgini/dataset.py,sha256=pQ8JQe0cdygD-W9GefJmfE6bnj4EYzXsjlgWdIS9nS8,31578
@@ -16,9 +16,9 @@ upgini/autofe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  upgini/autofe/all_operators.py,sha256=rdjF5eaE4bC6Q4eu_el5Z7ekYt8DjOFermz2bePPbUc,333
17
17
  upgini/autofe/binary.py,sha256=oOEECc4nRzZN2tYaiqx8F2XHnfWpk1bVvb7ZkZJ0lO8,7709
18
18
  upgini/autofe/date.py,sha256=RvexgrL1_6ISYPVrl9HUQmPgpVSGQsTNv8YhNQWs-5M,11329
19
- upgini/autofe/feature.py,sha256=2jOdTTnUqdUewznxsveuTLgKcPLPNtFWS0YQsYYBbPk,16622
19
+ upgini/autofe/feature.py,sha256=32uZfa7isXcMpvZiQyMYD3M02lIWjEc0vAheBr07ZP8,16662
20
20
  upgini/autofe/groupby.py,sha256=IYmQV9uoCdRcpkeWZj_kI3ObzoNCNx3ff3h8sTL01tk,3603
21
- upgini/autofe/operator.py,sha256=RB3rKMjFi5Cx81RiYXN3OTCuXjmvzmFKQrxn4h0Oclo,5219
21
+ upgini/autofe/operator.py,sha256=R2VoE3QAUoHPzzcmzRWROGq2OmegZOdZlTLRDZfrM7s,6279
22
22
  upgini/autofe/unary.py,sha256=FFtvkQaT0cu_zPZ1jCLcsjik-UUh12qQFF3tUW8NqsE,6675
23
23
  upgini/autofe/utils.py,sha256=dYrtyAM8Vcc_R8u4dNo54IsGrHKagTHDJTKhGho0bRg,2967
24
24
  upgini/autofe/vector.py,sha256=r5H6DKT5f3KNjERpV2OOloZ96nDWkModXnpsqw_A77Q,2313
@@ -74,7 +74,7 @@ upgini/utils/target_utils.py,sha256=GCPn4QeJ83JJ_vyBJ3IhY5fyIRkLC9q9BE59S2FRO1I,
74
74
  upgini/utils/track_info.py,sha256=G5Lu1xxakg2_TQjKZk4b5SvrHsATTXNVV3NbvWtT8k8,5663
75
75
  upgini/utils/ts_utils.py,sha256=26vhC0pN7vLXK6R09EEkMK3Lwb9IVPH7LRdqFIQ3kPs,1383
76
76
  upgini/utils/warning_counter.py,sha256=-GRY8EUggEBKODPSuXAkHn9KnEQwAORC0mmz_tim-PM,254
77
- upgini-1.2.122a1.dist-info/METADATA,sha256=3pPdEVaYucgJB5Klks339i5-JTM7hJpEZUmZS7dEWi8,50745
78
- upgini-1.2.122a1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
79
- upgini-1.2.122a1.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
80
- upgini-1.2.122a1.dist-info/RECORD,,
77
+ upgini-1.2.122a2.dist-info/METADATA,sha256=Nd9Mzf8ebdrmu35KxUkg72unHIM5eVAuoOnpw6gKW3o,50745
78
+ upgini-1.2.122a2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
79
+ upgini-1.2.122a2.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
80
+ upgini-1.2.122a2.dist-info/RECORD,,