upgini 1.1.305__py3-none-any.whl → 1.1.307__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.

Potentially problematic release.


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

upgini/__about__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.1.305"
1
+ __version__ = "1.1.307"
upgini/__init__.py CHANGED
@@ -1,7 +1,11 @@
1
+ import os
2
+
1
3
  from .lazy_import import LazyImport
2
4
 
3
- FeaturesEnricher = LazyImport('upgini.features_enricher', 'FeaturesEnricher')
4
- SearchKey = LazyImport('upgini.metadata', 'SearchKey')
5
- RuntimeParameters = LazyImport('upgini.metadata', 'RuntimeParameters')
6
- CVType = LazyImport('upgini.metadata', 'CVType')
7
- ModelTaskType = LazyImport('upgini.metadata', 'ModelTaskType')
5
+ os.environ["SETUPTOOLS_USE_DISTUTILS"] = "stdlib"
6
+
7
+ FeaturesEnricher = LazyImport("upgini.features_enricher", "FeaturesEnricher")
8
+ SearchKey = LazyImport("upgini.metadata", "SearchKey")
9
+ RuntimeParameters = LazyImport("upgini.metadata", "RuntimeParameters")
10
+ CVType = LazyImport("upgini.metadata", "CVType")
11
+ ModelTaskType = LazyImport("upgini.metadata", "ModelTaskType")
@@ -418,3 +418,19 @@ class DataSourcePublisher:
418
418
  response = self._rest_client.union_search_tasks(request, "trace_id")
419
419
  print(response)
420
420
  return response
421
+
422
+ def reannounce_all_ads(self):
423
+ trace_id = str(uuid.uuid4())
424
+ with MDC(trace_id=trace_id):
425
+ try:
426
+ task_id = self._rest_client.reannounce_all_ads(trace_id)
427
+ with Spinner():
428
+ status_response = self._rest_client.poll_ads_management_task_status(task_id, trace_id)
429
+ while status_response["status"] not in self.FINAL_STATUSES:
430
+ time.sleep(5)
431
+ status_response = self._rest_client.poll_ads_management_task_status(task_id, trace_id)
432
+
433
+ if status_response["status"] != "COMPLETED":
434
+ raise Exception("Failed to reannounce all ADS: " + status_response["errorMessage"])
435
+ except Exception:
436
+ self.logger.exception("Failed to reannounce all ADS-es")
@@ -2300,8 +2300,6 @@ class FeaturesEnricher(TransformerMixin):
2300
2300
  self.fit_search_keys = self.search_keys.copy()
2301
2301
  self.fit_search_keys = self.__prepare_search_keys(validated_X, self.fit_search_keys, is_demo_dataset)
2302
2302
 
2303
- validate_dates_distribution(validated_X, self.fit_search_keys, self.logger, self.bundle, self.warning_counter)
2304
-
2305
2303
  maybe_date_column = self._get_date_column(self.fit_search_keys)
2306
2304
  has_date = maybe_date_column is not None
2307
2305
  model_task_type = self.model_task_type or define_task(validated_y, has_date, self.logger)
@@ -2322,9 +2320,6 @@ class FeaturesEnricher(TransformerMixin):
2322
2320
 
2323
2321
  df = self.__handle_index_search_keys(df, self.fit_search_keys)
2324
2322
 
2325
- if is_numeric_dtype(df[self.TARGET_NAME]) and has_date:
2326
- self._validate_PSI(df.sort_values(by=maybe_date_column))
2327
-
2328
2323
  if DEFAULT_INDEX in df.columns:
2329
2324
  msg = self.bundle.get("unsupported_index_column")
2330
2325
  self.logger.info(msg)
@@ -2334,26 +2329,33 @@ class FeaturesEnricher(TransformerMixin):
2334
2329
 
2335
2330
  df = self.__add_country_code(df, self.fit_search_keys)
2336
2331
 
2337
- df = remove_fintech_duplicates(
2338
- df, self.fit_search_keys, date_format=self.date_format, logger=self.logger, bundle=self.bundle
2339
- )
2340
- df = clean_full_duplicates(df, self.logger, bundle=self.bundle)
2341
-
2342
- date_column = self._get_date_column(self.fit_search_keys)
2343
- self.__adjust_cv(df, date_column, model_task_type)
2344
-
2345
2332
  self.fit_generated_features = []
2346
2333
 
2347
- if date_column is not None:
2348
- converter = DateTimeSearchKeyConverter(date_column, self.date_format, self.logger, bundle=self.bundle)
2334
+ if has_date:
2335
+ converter = DateTimeSearchKeyConverter(maybe_date_column, self.date_format, self.logger, bundle=self.bundle)
2349
2336
  df = converter.convert(df, keep_time=True)
2350
- self.logger.info(f"Date column after convertion: {df[date_column]}")
2337
+ self.logger.info(f"Date column after convertion: {df[maybe_date_column]}")
2351
2338
  self.fit_generated_features.extend(converter.generated_features)
2352
2339
  else:
2353
2340
  self.logger.info("Input dataset hasn't date column")
2354
2341
  if self.add_date_if_missing:
2355
2342
  df = self._add_current_date_as_key(df, self.fit_search_keys, self.logger, self.bundle)
2356
2343
 
2344
+ # Checks that need validated date
2345
+ validate_dates_distribution(validated_X, self.fit_search_keys, self.logger, self.bundle, self.warning_counter)
2346
+
2347
+ if is_numeric_dtype(df[self.TARGET_NAME]) and has_date:
2348
+ self._validate_PSI(df.sort_values(by=maybe_date_column))
2349
+
2350
+ self.__adjust_cv(df, maybe_date_column, model_task_type)
2351
+
2352
+ # TODO normalize and convert all columns
2353
+
2354
+ df = remove_fintech_duplicates(
2355
+ df, self.fit_search_keys, date_format=self.date_format, logger=self.logger, bundle=self.bundle
2356
+ )
2357
+ df = clean_full_duplicates(df, self.logger, bundle=self.bundle)
2358
+
2357
2359
  if (
2358
2360
  self.detect_missing_search_keys
2359
2361
  and list(self.fit_search_keys.values()) == [SearchKey.DATE]
upgini/http.py CHANGED
@@ -285,6 +285,7 @@ class _RestClient:
285
285
  DEACTIVATE_ADS_URI = "private/api/v2/ads/deactivate"
286
286
  TOGGLE_ADS_URI_FMT = "private/api/v2/ads/{0}/toggle"
287
287
  DELETE_ADS_URI_FMT = "private/api/v2/ads/{0}"
288
+ REANNOUNCE_ALL_ADS_URI_FMT = "private/api/v2/ads/reannounce-all-ads"
288
289
  POLL_ADS_MANAGEMENT_STATUS_URI_FMT = "private/api/v2/ads/management-task/{0}"
289
290
  GET_ADS_DESCRIPTION_URI_FMT = "private/api/v2/ads/{0}"
290
291
  GET_ALL_ADS_DESCRIPTIONS_URI = "private/api/v2/ads/descriptions"
@@ -726,6 +727,11 @@ class _RestClient:
726
727
  api_path = self.DEACTIVATE_ADS_URI
727
728
  self._with_unauth_retry(lambda: self._send_post_req(api_path, trace_id, request, result_format=None))
728
729
 
730
+ def reannounce_all_ads(self, trace_id: str) -> str:
731
+ api_path = self.REANNOUNCE_ALL_ADS_URI_FMT
732
+ response = self._with_unauth_retry(lambda: self._send_post_req(api_path, trace_id))
733
+ return response["adsManagementTaskId"]
734
+
729
735
  def toggle_ads(self, ads_definition_id: str, trace_id: str):
730
736
  api_path = self.TOGGLE_ADS_URI_FMT.format(ads_definition_id)
731
737
  return self._with_unauth_retry(lambda: self._send_post_req(api_path, trace_id))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: upgini
3
- Version: 1.1.305
3
+ Version: 1.1.307
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,10 +1,10 @@
1
- upgini/__about__.py,sha256=QMF-ZjUcnh9mDz_6F2wxDw2kRy9dur-Ngw1eE7MTiR4,24
2
- upgini/__init__.py,sha256=ObEtjFkIssl83qeKNMLpIQygfwK8TzztwiI43YTsAP0,353
1
+ upgini/__about__.py,sha256=Sn0l4v1zhcKcI7IkU-4gpLRv1k03kr7gu6biIIfnoLM,24
2
+ upgini/__init__.py,sha256=Xs0YFVBu1KUdtZzbStGRPQtLt3YLzJnjx5nIUBlX8BE,415
3
3
  upgini/ads.py,sha256=nvuRxRx5MHDMgPr9SiU-fsqRdFaBv8p4_v1oqiysKpc,2714
4
4
  upgini/dataset.py,sha256=MOzBVsvzlHLxNfPWtMaXC_jIPeW7_gUvbSGeXnsPgNI,46158
5
5
  upgini/errors.py,sha256=2b_Wbo0OYhLUbrZqdLIx5jBnAsiD1Mcenh-VjR4HCTw,950
6
- upgini/features_enricher.py,sha256=8grYkWdix0NogYAY7YjUVe2Tqfra6NAxM78N9MlLF30,183572
7
- upgini/http.py,sha256=bp6jWl422Icy3AhHMdCcJv5NjExE45gSMmzMTPJjPuk,42600
6
+ upgini/features_enricher.py,sha256=87gU9dwSjdqJ5ebOnDPk9gKvoLj6XZvpO5mkIbnaWNE,183601
7
+ upgini/http.py,sha256=a4Epc9YLIJBuYk4t8E_2-QDLBtJFqKO35jn2SnYQZCg,42920
8
8
  upgini/lazy_import.py,sha256=EwoM0msNGbSmWBhGbrLDny1DSnOlvTxCjmMKPxYlDms,610
9
9
  upgini/metadata.py,sha256=E5WWZ_MkjGyYNQh_LnwMIBHyqPx1fxk-qhEfQIJnzq8,10209
10
10
  upgini/metrics.py,sha256=Tu5cN8RlhOSSMWUTXRSkdl8SWBqR1N_2eJpBum9pZxc,30926
@@ -23,7 +23,7 @@ upgini/autofe/operand.py,sha256=MKEsl3zxpWzRDpTkE0sNJxTu62U20sWOvEKhPjUWS6s,2915
23
23
  upgini/autofe/unary.py,sha256=ZWjLd-CUkNt_PpM8YuWLLipW1v_RdBlsl4JxXIVo9aM,3652
24
24
  upgini/autofe/vector.py,sha256=dLxfAstJs-gw_OQ1xxoxcM6pVzORlV0HVzdzt7cLXVQ,606
25
25
  upgini/data_source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- upgini/data_source/data_source_publisher.py,sha256=aCVpZ3RGlYToRYYNHjC2BxIxnnKUyrrF29MncCXhVlE,19716
26
+ upgini/data_source/data_source_publisher.py,sha256=y0tYFp7N3bSI7BwQ5SRF8r0bRaI3z6Zc1fsZezVg7hE,20552
27
27
  upgini/mdc/__init__.py,sha256=aM08nIWFc2gWdWUa3_IuEnNND0cQPkBGnYpRMnfFN8k,1019
28
28
  upgini/mdc/context.py,sha256=3u1B-jXt7tXEvNcV3qmR9SDCseudnY7KYsLclBdwVLk,1405
29
29
  upgini/normalizer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -57,7 +57,7 @@ upgini/utils/sklearn_ext.py,sha256=13jQS_k7v0aUtudXV6nGUEWjttPQzAW9AFYL5wgEz9k,4
57
57
  upgini/utils/target_utils.py,sha256=Y96_PJ5cC-WsEbeqg20v9uqywDQobLoTb-xoP7S3o4E,7807
58
58
  upgini/utils/track_info.py,sha256=G5Lu1xxakg2_TQjKZk4b5SvrHsATTXNVV3NbvWtT8k8,5663
59
59
  upgini/utils/warning_counter.py,sha256=dIWBB4dI5XRRJZudvIlqlIYKEiwLLPcXarsZuYRt338,227
60
- upgini-1.1.305.dist-info/METADATA,sha256=xeEcJbbZ8LrhTyzLvyGR9I5FsVC2gP1Rn65cPo3gJrg,48153
61
- upgini-1.1.305.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
62
- upgini-1.1.305.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
63
- upgini-1.1.305.dist-info/RECORD,,
60
+ upgini-1.1.307.dist-info/METADATA,sha256=-HQpKKy8UA3w6J6Oi6WNYgqmaqCOWQmlVGaV7B5VBZc,48153
61
+ upgini-1.1.307.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
62
+ upgini-1.1.307.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
63
+ upgini-1.1.307.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.24.2
2
+ Generator: hatchling 1.25.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any