upgini 1.2.84__py3-none-any.whl → 1.2.85__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.2.84"
1
+ __version__ = "1.2.85"
@@ -3,6 +3,7 @@ import datetime
3
3
  import gc
4
4
  import hashlib
5
5
  import itertools
6
+ import json
6
7
  import logging
7
8
  import numbers
8
9
  import os
@@ -59,6 +60,7 @@ from upgini.metadata import (
59
60
  CVType,
60
61
  FeaturesMetadataV2,
61
62
  FileColumnMeaningType,
63
+ FileColumnMetadata,
62
64
  ModelTaskType,
63
65
  RuntimeParameters,
64
66
  SearchKey,
@@ -2152,7 +2154,7 @@ class FeaturesEnricher(TransformerMixin):
2152
2154
  trace_id = trace_id or uuid.uuid4()
2153
2155
  return search_task.get_progress(trace_id)
2154
2156
 
2155
- def get_transactional_transform_api(self, only_online_sources=False):
2157
+ def display_transactional_transform_api(self, only_online_sources=False):
2156
2158
  if self.api_key is None:
2157
2159
  raise ValidationError(self.bundle.get("transactional_transform_unregistered"))
2158
2160
  if self._search_task is None:
@@ -2178,20 +2180,36 @@ class FeaturesEnricher(TransformerMixin):
2178
2180
  return "test_value"
2179
2181
 
2180
2182
  file_metadata = self._search_task.get_file_metadata(str(uuid.uuid4()))
2183
+
2184
+ def get_column_meta(column_name: str) -> FileColumnMetadata:
2185
+ for c in file_metadata.columns:
2186
+ if c.name == column_name:
2187
+ return c
2188
+
2181
2189
  search_keys = file_metadata.search_types()
2182
2190
  if SearchKey.IPV6_ADDRESS in search_keys:
2183
2191
  search_keys.pop(SearchKey.IPV6_ADDRESS, None)
2184
- original_names = {c.name: c.originalName for c in file_metadata.columns}
2185
- keys = (
2186
- "{"
2187
- + ", ".join(
2188
- [
2189
- f'"{key.name}": {{"name": "{original_names.get(name, name)}", "value": "{key_example(key)}"}}'
2190
- for key, name in search_keys.items()
2191
- ]
2192
- )
2193
- + "}"
2194
- )
2192
+
2193
+ search_keys_with_values = dict()
2194
+ for sk_type, sk_name in search_keys.items():
2195
+ if sk_type == SearchKey.IPV6_ADDRESS:
2196
+ continue
2197
+
2198
+ sk_meta = get_column_meta(sk_name)
2199
+ if sk_meta is None:
2200
+ search_keys_with_values[sk_type.name] = [{"name": sk_name, "value": key_example(sk_type)}]
2201
+ else:
2202
+ if sk_meta.isUnnest:
2203
+ search_keys_with_values[sk_type.name] = [
2204
+ {"name": name, "value": key_example(sk_type)} for name in sk_meta.unnestKeyNames
2205
+ ]
2206
+ else:
2207
+ search_keys_with_values[sk_type.name] = [{
2208
+ "name": sk_meta.originalName,
2209
+ "value": key_example(sk_type),
2210
+ }]
2211
+
2212
+ keys_section = json.dumps(search_keys_with_values)
2195
2213
  features_for_transform = self._search_task.get_features_for_transform()
2196
2214
  if features_for_transform:
2197
2215
  original_features_for_transform = [
@@ -2212,7 +2230,7 @@ class FeaturesEnricher(TransformerMixin):
2212
2230
  curl 'https://search.upgini.com/online/api/http_inference_trigger?search_id={search_id}' \\
2213
2231
  -H 'Authorization: {self.api_key}' \\
2214
2232
  -H 'Content-Type: application/json' \\
2215
- -d '{{"search_keys": {keys}{features_section}, "only_online_sources": {str(only_online_sources).lower()}}}'
2233
+ -d '{{"search_keys": {keys_section}{features_section}, "only_online_sources": {str(only_online_sources).lower()}}}'
2216
2234
 
2217
2235
  {Format.BOLD}Python{Format.END}:
2218
2236
 
@@ -2221,13 +2239,12 @@ import requests
2221
2239
  response = requests.post(
2222
2240
  url='https://search.upgini.com/online/api/http_inference_trigger?search_id={search_id}',
2223
2241
  headers={{'Authorization': '{self.api_key}'}},
2224
- json={{"search_keys": {keys}{features_section}, "only_online_sources": {only_online_sources}}}
2242
+ json={{"search_keys": {keys_section}{features_section}, "only_online_sources": {only_online_sources}}}
2225
2243
  )
2226
2244
  if response.status_code == 200:
2227
2245
  print(response.json())
2228
2246
  """
2229
-
2230
- return api_example
2247
+ print(api_example)
2231
2248
 
2232
2249
  def _get_copy_of_runtime_parameters(self) -> RuntimeParameters:
2233
2250
  return RuntimeParameters(properties=self.runtime_parameters.properties.copy())
@@ -2288,7 +2305,7 @@ if response.status_code == 200:
2288
2305
  msg = self.bundle.get("online_api_features_transform").format(online_api_features)
2289
2306
  self.logger.warning(msg)
2290
2307
  print(msg)
2291
- print(self.get_transactional_transform_api(only_online_sources=True))
2308
+ self.display_transactional_transform_api(only_online_sources=True)
2292
2309
 
2293
2310
  if not metrics_calculation:
2294
2311
  transform_usage = self.rest_client.get_current_transform_usage(trace_id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: upgini
3
- Version: 1.2.84
3
+ Version: 1.2.85
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,9 +1,9 @@
1
- upgini/__about__.py,sha256=aeTule-I84yrLN0UOJAi64jLCLq3VVYxtUewFZihoH8,23
1
+ upgini/__about__.py,sha256=GQcOPY8MByuUtzBlWgL-5Ml2KS1SWi19jFLxrEPAY_Q,23
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=fRtqSkXNONLnPe6cCL967GMt349FTIpXzy_u8LUKncw,35354
5
5
  upgini/errors.py,sha256=2b_Wbo0OYhLUbrZqdLIx5jBnAsiD1Mcenh-VjR4HCTw,950
6
- upgini/features_enricher.py,sha256=2ryADtOVEEebuUBhimusvnBzGxUkdTaqpEh2F1PqHSs,212719
6
+ upgini/features_enricher.py,sha256=G0qbRPdlWe9p6cwYF3khP99-0kgAO8N0A2sfQxSLgmM,213446
7
7
  upgini/http.py,sha256=AfaJ3c8z_tK2hZFEehNybDKE0mp1tYcyAP_l0_p8bLQ,43933
8
8
  upgini/metadata.py,sha256=zt_9k0iQbWXuiRZcel4ORNPdQKt6Ou69ucZD_E1Q46o,12341
9
9
  upgini/metrics.py,sha256=3cip0_L6-OFew74KsRwzxJDU6UFq05h2v7IsyHLcMRc,43164
@@ -70,7 +70,7 @@ upgini/utils/target_utils.py,sha256=LRN840dzx78-wg7ftdxAkp2c1eu8-JDvkACiRThm4HE,
70
70
  upgini/utils/track_info.py,sha256=G5Lu1xxakg2_TQjKZk4b5SvrHsATTXNVV3NbvWtT8k8,5663
71
71
  upgini/utils/ts_utils.py,sha256=26vhC0pN7vLXK6R09EEkMK3Lwb9IVPH7LRdqFIQ3kPs,1383
72
72
  upgini/utils/warning_counter.py,sha256=-GRY8EUggEBKODPSuXAkHn9KnEQwAORC0mmz_tim-PM,254
73
- upgini-1.2.84.dist-info/METADATA,sha256=jn2nCo_PdZx_hdSQYi9RFAFY7XyzgLlvz-U-WSY9Hm0,49162
74
- upgini-1.2.84.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
75
- upgini-1.2.84.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
76
- upgini-1.2.84.dist-info/RECORD,,
73
+ upgini-1.2.85.dist-info/METADATA,sha256=cEtUjRx8eUntASmye2LUmZX78RCWtrMm43z2ZCWyhW8,49162
74
+ upgini-1.2.85.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
75
+ upgini-1.2.85.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
76
+ upgini-1.2.85.dist-info/RECORD,,