upgini 1.2.113a3974.dev1__py3-none-any.whl → 1.2.114a1__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.113a3974.dev1"
1
+ __version__ = "1.2.114a1"
upgini/autofe/date.py CHANGED
@@ -244,7 +244,8 @@ class DateListDiffBounded(DateListDiff, ParametrizedOperator):
244
244
 
245
245
  class DatePercentileBase(PandasOperator, abc.ABC):
246
246
  is_binary: bool = True
247
- output_type: Optional[str] = "float"
247
+ is_categorical: bool = True
248
+ output_type: Optional[str] = "category"
248
249
 
249
250
  date_unit: Optional[str] = None
250
251
 
@@ -254,7 +255,12 @@ class DatePercentileBase(PandasOperator, abc.ABC):
254
255
 
255
256
  bounds = self._get_bounds(left)
256
257
 
257
- return right.index.to_series().apply(lambda i: self._perc(right[i], bounds[i]))
258
+ return (
259
+ right.index.to_series()
260
+ .apply(lambda i: self._perc(right[i], bounds[i]))
261
+ .astype(pd.Int64Dtype())
262
+ .astype("category")
263
+ )
258
264
 
259
265
  @abc.abstractmethod
260
266
  def _get_bounds(self, date_col: pd.Series) -> pd.Series:
@@ -318,8 +324,6 @@ class DatePercentile(DatePercentileBase):
318
324
 
319
325
  class DatePercentileMethod2(DatePercentileBase):
320
326
  name: str = "date_per_method2"
321
- is_categorical: bool = True
322
- output_type: Optional[str] = "category"
323
327
 
324
328
  def _get_bounds(self, date_col: pd.Series) -> pd.Series:
325
329
  pass
upgini/dataset.py CHANGED
@@ -343,7 +343,9 @@ class Dataset:
343
343
  if col in mandatory_columns:
344
344
  self.data["valid_mandatory"] = self.data["valid_mandatory"] & self.data[f"{col}_is_valid"]
345
345
 
346
- invalid_values = list(set(self.data.loc[self.data[f"{col}_is_valid"] == 0, col].head().values))
346
+ # Use stable pandas API across versions: Series.unique keeps order
347
+ # and collapses multiple NaNs into a single NaN
348
+ invalid_values = self.data.loc[self.data[f"{col}_is_valid"] == 0, col].unique().tolist()[:5]
347
349
  valid_share = self.data[f"{col}_is_valid"].sum() / nrows
348
350
  original_col_name = self.columns_renaming[col]
349
351
  validation_stats[original_col_name] = {}