tdfs4ds 0.2.4.30__py3-none-any.whl → 0.2.4.31__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.
tdfs4ds/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = '0.2.4.30'
1
+ __version__ = '0.2.4.31'
2
2
  import logging
3
3
  # Setup the logger
4
4
  logging.basicConfig(
@@ -251,33 +251,72 @@ def get_list_features(entity_name, domain=None):
251
251
 
252
252
  def get_feature_versions(entity_name, features, domain=None):
253
253
  """
254
- Retrieve version UUID(s) for the given features of an entity within a domain.
254
+ Retrieve version identifiers for one or more features belonging to a given entity.
255
+
256
+ The function queries the underlying metadata tables to find the *process*
257
+ (i.e., feature‑version) records that match the supplied entity and feature
258
+ names. It returns a mapping from each requested feature name to either:
259
+
260
+ * **None** – if no matching rows were found.
261
+ * A single UUID string – if exactly one matching row exists for the feature.
262
+ * A list of dictionaries – if more than one matching row is found; each
263
+ dictionary contains:
264
+ ``process_id`` – the UUID of the process that produced the
265
+ version,
266
+ ``process_view_name`` – the human‑readable view name associated with
267
+ that process.
268
+
269
+ Parameters
270
+ ----------
271
+ entity_name : str | list[str]
272
+ The name (or names) of the entity whose features we are querying.
273
+ If a single string is supplied it is treated as a singleton list.
274
+
275
+ features : str | list[str]
276
+ One or more feature names to look up. Accepts a single string or
277
+ an iterable of strings; if a single string is provided it is wrapped in
278
+ a list internally.
279
+
280
+ domain : str, optional
281
+ The data‑domain partition to filter on. If omitted the default
282
+ ``tdfs4ds.DATA_DOMAIN`` constant is used.
283
+
284
+ Returns
285
+ -------
286
+ dict[str, str | None | list[dict]]
287
+ A dictionary keyed by feature name. Each value is either:
288
+ * ``None`` – no records were found for that feature.
289
+ * ``str`` – a single UUID string when exactly one row matched.
290
+ * ``list[dict]`` – multiple matches; each dict has keys
291
+ ``process_id`` and ``process_view_name``.
292
+
293
+ Notes
294
+ -----
295
+ * The query joins the feature catalog view with the process catalog
296
+ (specifically the “feature split” view) on data domain, entity ID,
297
+ and feature name.
298
+ * SQL string literals are escaped by doubling single quotes; this is a
299
+ lightweight escape that suffices for the current use‑case.
300
+ * The function preserves insertion order of features in the returned
301
+ dictionary (Python 3.7+ guarantees dict order).
302
+ * When ``tdfs4ds.DEBUG_MODE`` is true, the generated SQL statement is
303
+ printed to stdout – useful for troubleshooting.
304
+
305
+ Example
306
+ -------
307
+ >>> get_feature_versions('user', ['age', 'income'])
308
+ {'age': 'c1d2e3f4-...', 'income': None}
255
309
 
256
- Parameters:
257
- - entity_name (str): The entity name to which the features belong.
258
- - features (str | list[str]): Feature name or list of feature names.
259
- - domain (str, optional): Data domain to filter on. If None, defaults to tdfs4ds.DATA_DOMAIN.
260
-
261
- Returns:
262
- - dict[str, str | list[dict]]: Maps each requested feature name to either:
263
- - a single version UUID string if exactly one row exists, or
264
- - a list of dicts if multiple rows exist; each dict has:
265
- {
266
- "process_id": <FEATURE_VERSION UUID>,
267
- "process_view_name": <PROCESS_VIEW_NAME string>
268
- }
269
- If a requested feature has no entries, it will be present with value None.
270
-
271
- Notes:
272
- - Uses {tdfs4ds.SCHEMA}.{tdfs4ds.FEATURE_CATALOG_NAME} as A and
273
- {tdfs4ds.SCHEMA}.{tdfs4ds.PROCESS_CATALOG_NAME} as B (must exist) joined on PROCESS_ID.
274
- - Respects tdfs4ds.DEBUG_MODE to print the generated SQL.
275
310
  """
276
311
 
312
+
277
313
  # Normalize inputs
278
314
  if isinstance(features, str):
279
315
  features = [features]
280
316
 
317
+ if isinstance(entity_name, str):
318
+ entity_name = [entity_name]
319
+
281
320
  if domain is None:
282
321
  domain = tdfs4ds.DATA_DOMAIN
283
322
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tdfs4ds
3
- Version: 0.2.4.30
3
+ Version: 0.2.4.31
4
4
  Summary: A python package to simplify the usage of feature store using Teradata Vantage ...
5
5
  Author: Denis Molin
6
6
  Requires-Python: >=3.6
@@ -2,7 +2,7 @@ tdfs/__init__.py,sha256=7AcO7uB1opRCt7t2JOHworKimfAaDeO3boRW7u9Geo8,23
2
2
  tdfs/datasets.py,sha256=-b2MPEKGki2V1M8iUcoDR9uc2krIK7u1CK-EhChvihs,985
3
3
  tdfs/feature_store.py,sha256=Honu7eOAXxP4Ivz0mRlhuNkfTDzgZl5HB1WlQUwzcZ0,31354
4
4
  tdfs/data/curves.csv,sha256=q0Tm-0yu7VMK4lHvHpgi1LMeRq0lO5gJy2Q17brKbEM,112488
5
- tdfs4ds/__init__.py,sha256=i-bbHzjX6MjTP-WcdZ26Ur-FwB8WT2_ux7GZeCzRQS8,66290
5
+ tdfs4ds/__init__.py,sha256=Al8Ae5dlbMxjwuYgq6VTy6Cjtr9ZxfiRpjhlHguKLRQ,66290
6
6
  tdfs4ds/datasets.py,sha256=LE4Gn0muwdyrIrCrbkE92cnafUML63z1lj5bFIIVzmc,3524
7
7
  tdfs4ds/feature_engineering.py,sha256=oVnZ2V_XNGE12LKC_fNfkrWSQZLgtYRmaf8Dispi6S4,7081
8
8
  tdfs4ds/feature_store.py,sha256=y-oItPZw6nBkBcGAceaATZbkLPTsvpk0OnpzTxYofDs,68576
@@ -18,7 +18,7 @@ tdfs4ds/dataset/dataset_catalog.py,sha256=qxS2thDW2MvsRouSFaX1M0sX2J7IzBAYD8Yf22
18
18
  tdfs4ds/feature_store/__init__.py,sha256=a7NPCkpTx40UR5LRErwnskpABG2Vuib7F5wUjaUGCnI,209
19
19
  tdfs4ds/feature_store/entity_management.py,sha256=9ltytv3yCTG84NZXBpb1Tlkf9pOxvrNb0MVidU4pwvE,10157
20
20
  tdfs4ds/feature_store/feature_data_processing.py,sha256=rvpnFrV6Tmg8C6xcSQLT_lrFYqZsdSzFXmS-4suK9qg,42847
21
- tdfs4ds/feature_store/feature_query_retrieval.py,sha256=qqnUsg2Iw1nNvTqBZLwEwBNxwDcSZh0QX29mycjdwvU,33780
21
+ tdfs4ds/feature_store/feature_query_retrieval.py,sha256=51c6ZNlLFiBIxNPinS8ot8bjWEIb1QV2eVg69yzVF80,35381
22
22
  tdfs4ds/feature_store/feature_store_management.py,sha256=pWM9sjppBgRIg3l1ksoDJsM1fnaZlWtnuE3JuOP_2mY,54736
23
23
  tdfs4ds/process_store/__init__.py,sha256=npHR_xju5ecGmWfYHDyteLwiU3x-cL4HD3sFK_th7xY,229
24
24
  tdfs4ds/process_store/process_followup.py,sha256=PvLcU7meg3ljBlPfuez3qwTVqpHHhVJxYxGqjgiHE8E,7265
@@ -32,7 +32,7 @@ tdfs4ds/utils/lineage.py,sha256=gy5M42qy5fvdWmlohAY3WPYoqAyp5VakeEmeT1YjrJQ,3783
32
32
  tdfs4ds/utils/query_management.py,sha256=nAcE8QY1GWAKgOtb-ubSfDVcnYbU7Ge8CruVRLoPtmY,6356
33
33
  tdfs4ds/utils/time_management.py,sha256=1eqGs7rT3SGag0F30R3PzwiC7Aa7DKia2Ud0aSNKcPg,10593
34
34
  tdfs4ds/utils/visualization.py,sha256=5S528KoKzzkrAdCxfy7ecyqKvAXBoibNvHwz_u5ISMs,23167
35
- tdfs4ds-0.2.4.30.dist-info/METADATA,sha256=cRbDpkXQL2aJoRBTES29Hba855N7TjfljM5rGkdtGTQ,14326
36
- tdfs4ds-0.2.4.30.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
37
- tdfs4ds-0.2.4.30.dist-info/top_level.txt,sha256=wMyVkMvnBn8RRt1xBveGQxOpWFijPMPkMiE7G2mi8zo,8
38
- tdfs4ds-0.2.4.30.dist-info/RECORD,,
35
+ tdfs4ds-0.2.4.31.dist-info/METADATA,sha256=LscQTdUHdZfJI8bxxJn3zJoXnAvrphbeemuArdE_9tM,14326
36
+ tdfs4ds-0.2.4.31.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
37
+ tdfs4ds-0.2.4.31.dist-info/top_level.txt,sha256=wMyVkMvnBn8RRt1xBveGQxOpWFijPMPkMiE7G2mi8zo,8
38
+ tdfs4ds-0.2.4.31.dist-info/RECORD,,