upgini 1.1.308__tar.gz → 1.1.309__tar.gz

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.

Potentially problematic release.


This version of upgini might be problematic. Click here for more details.

Files changed (65) hide show
  1. {upgini-1.1.308 → upgini-1.1.309}/PKG-INFO +1 -1
  2. upgini-1.1.309/src/upgini/__about__.py +1 -0
  3. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/data_source/data_source_publisher.py +21 -5
  4. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/features_enricher.py +10 -10
  5. upgini-1.1.308/src/upgini/__about__.py +0 -1
  6. {upgini-1.1.308 → upgini-1.1.309}/.gitignore +0 -0
  7. {upgini-1.1.308 → upgini-1.1.309}/LICENSE +0 -0
  8. {upgini-1.1.308 → upgini-1.1.309}/README.md +0 -0
  9. {upgini-1.1.308 → upgini-1.1.309}/pyproject.toml +0 -0
  10. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/__init__.py +0 -0
  11. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/ads.py +0 -0
  12. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/ads_management/__init__.py +0 -0
  13. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/ads_management/ads_manager.py +0 -0
  14. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/autofe/__init__.py +0 -0
  15. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/autofe/all_operands.py +0 -0
  16. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/autofe/binary.py +0 -0
  17. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/autofe/date.py +0 -0
  18. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/autofe/feature.py +0 -0
  19. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/autofe/groupby.py +0 -0
  20. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/autofe/operand.py +0 -0
  21. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/autofe/unary.py +0 -0
  22. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/autofe/vector.py +0 -0
  23. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/data_source/__init__.py +0 -0
  24. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/dataset.py +0 -0
  25. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/errors.py +0 -0
  26. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/http.py +0 -0
  27. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/lazy_import.py +0 -0
  28. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/mdc/__init__.py +0 -0
  29. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/mdc/context.py +0 -0
  30. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/metadata.py +0 -0
  31. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/metrics.py +0 -0
  32. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/normalizer/__init__.py +0 -0
  33. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/normalizer/phone_normalizer.py +0 -0
  34. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/resource_bundle/__init__.py +0 -0
  35. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/resource_bundle/exceptions.py +0 -0
  36. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/resource_bundle/strings.properties +0 -0
  37. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/resource_bundle/strings_widget.properties +0 -0
  38. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/sampler/__init__.py +0 -0
  39. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/sampler/base.py +0 -0
  40. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/sampler/random_under_sampler.py +0 -0
  41. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/sampler/utils.py +0 -0
  42. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/search_task.py +0 -0
  43. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/spinner.py +0 -0
  44. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/__init__.py +0 -0
  45. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/base_search_key_detector.py +0 -0
  46. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/blocked_time_series.py +0 -0
  47. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/country_utils.py +0 -0
  48. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/custom_loss_utils.py +0 -0
  49. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/cv_utils.py +0 -0
  50. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/datetime_utils.py +0 -0
  51. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/deduplicate_utils.py +0 -0
  52. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/display_utils.py +0 -0
  53. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/email_utils.py +0 -0
  54. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/fallback_progress_bar.py +0 -0
  55. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/features_validator.py +0 -0
  56. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/format.py +0 -0
  57. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/ip_utils.py +0 -0
  58. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/phone_utils.py +0 -0
  59. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/postal_code_utils.py +0 -0
  60. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/progress_bar.py +0 -0
  61. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/sklearn_ext.py +0 -0
  62. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/target_utils.py +0 -0
  63. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/track_info.py +0 -0
  64. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/utils/warning_counter.py +0 -0
  65. {upgini-1.1.308 → upgini-1.1.309}/src/upgini/version_validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: upgini
3
- Version: 1.1.308
3
+ Version: 1.1.309
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/
@@ -0,0 +1 @@
1
+ __version__ = "1.1.309"
@@ -3,7 +3,7 @@ import time
3
3
  import uuid
4
4
  from datetime import datetime
5
5
  from enum import Enum
6
- from typing import Dict, List, Optional, Union
6
+ from typing import Dict, List, Literal, Optional, Union
7
7
 
8
8
  from upgini.errors import HttpError, ValidationError
9
9
  from upgini.http import LoggerFactory, get_rest_client
@@ -47,7 +47,9 @@ class DataSourcePublisher:
47
47
  self,
48
48
  data_table_uri: str,
49
49
  search_keys: Dict[str, SearchKey],
50
- update_frequency: str,
50
+ update_frequency: (
51
+ Literal["Daily"] | Literal["Weekly"] | Literal["Monthly"] | Literal["Quarterly"] | Literal["Annually"]
52
+ ),
51
53
  exclude_from_autofe_generation: Optional[List[str]],
52
54
  secondary_search_keys: Optional[Dict[str, SearchKey]] = None,
53
55
  sort_column: Optional[str] = None,
@@ -233,11 +235,17 @@ class DataSourcePublisher:
233
235
  self.logger.exception("Failed to register data table")
234
236
  raise
235
237
 
236
- def remove(self, data_table_ids: List[str]):
238
+ def remove(self, data_table_ids: List[str] | str):
237
239
  trace_id = str(uuid.uuid4())
238
240
  with MDC(trace_id=trace_id):
239
241
  try:
240
- if data_table_ids is None or len(data_table_ids) == 0:
242
+ if not data_table_ids:
243
+ raise ValidationError("Empty data table ids")
244
+ if isinstance(data_table_ids, str):
245
+ data_table_ids = [data_table_ids]
246
+ if not isinstance(data_table_ids, list):
247
+ raise ValidationError("Invalid format of data_table_ids argument")
248
+ if len(data_table_ids) == 0:
241
249
  raise ValidationError("Empty data table ids")
242
250
 
243
251
  for data_table_id in data_table_ids:
@@ -266,16 +274,20 @@ class DataSourcePublisher:
266
274
  source_link: Optional[str] = None,
267
275
  update_frequency: Optional[str] = None,
268
276
  client_emails: Optional[List[str]] = None,
277
+ date_features: Optional[List[str]] = None,
278
+ date_vector_features: Optional[List[str]] = None,
269
279
  ):
270
280
  trace_id = str(uuid.uuid4())
271
281
  with MDC(trace_id=trace_id):
272
282
  try:
273
- if data_table_ids is None or len(data_table_ids) == 0:
283
+ if data_table_ids is None:
274
284
  raise ValidationError("Empty data table ids")
275
285
  if isinstance(data_table_ids, str):
276
286
  data_table_ids = [data_table_ids]
277
287
  if not isinstance(data_table_ids, list):
278
288
  raise ValidationError("data_table_ids should be string or list of strings")
289
+ if len(data_table_ids) == 0:
290
+ raise ValidationError("Empty data table ids")
279
291
  if update_frequency is not None and update_frequency not in self.ACCEPTABLE_UPDATE_FREQUENCIES:
280
292
  raise ValidationError(
281
293
  f"Invalid update frequency: {update_frequency}. "
@@ -311,6 +323,10 @@ class DataSourcePublisher:
311
323
  request["updateFrequency"] = update_frequency
312
324
  if client_emails is not None:
313
325
  request["clientEmails"] = client_emails
326
+ if date_features is not None:
327
+ request["dateFeatures"] = date_features
328
+ if date_vector_features is not None:
329
+ request["dateVectorFeatures"] = date_vector_features
314
330
  self.logger.info(f"Activating data tables with request {request}")
315
331
 
316
332
  self._rest_client.activate_datatables(request, trace_id)
@@ -865,13 +865,6 @@ class FeaturesEnricher(TransformerMixin):
865
865
  if X is not None and y is None:
866
866
  raise ValidationError("X passed without y")
867
867
 
868
- if self.X is None:
869
- self.X = X
870
- if self.y is None:
871
- self.y = y
872
- if self.eval_set is None:
873
- self.eval_set = effective_eval_set
874
-
875
868
  validate_scoring_argument(scoring)
876
869
 
877
870
  self._validate_baseline_score(effective_X, effective_eval_set)
@@ -888,9 +881,9 @@ class FeaturesEnricher(TransformerMixin):
888
881
 
889
882
  prepared_data = self._prepare_data_for_metrics(
890
883
  trace_id=trace_id,
891
- X=effective_X,
892
- y=effective_y,
893
- eval_set=effective_eval_set,
884
+ X=X,
885
+ y=y,
886
+ eval_set=eval_set,
894
887
  exclude_features_sources=exclude_features_sources,
895
888
  importance_threshold=importance_threshold,
896
889
  max_features=max_features,
@@ -1135,6 +1128,13 @@ class FeaturesEnricher(TransformerMixin):
1135
1128
  elif uplift_col in metrics_df.columns and (metrics_df[uplift_col] < 0).any():
1136
1129
  self.logger.warning("Uplift is negative")
1137
1130
 
1131
+ if self.X is None:
1132
+ self.X = X
1133
+ if self.y is None:
1134
+ self.y = y
1135
+ if self.eval_set is None:
1136
+ self.eval_set = effective_eval_set
1137
+
1138
1138
  return metrics_df
1139
1139
  except Exception as e:
1140
1140
  error_message = "Failed to calculate metrics" + (
@@ -1 +0,0 @@
1
- __version__ = "1.1.308"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes