tdfs4ds 0.2.5.2__py3-none-any.whl → 0.2.5.3__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.5.2'
1
+ __version__ = '0.2.5.3'
2
2
  import difflib
3
3
  import logging
4
4
  import json
@@ -285,13 +285,37 @@ def prepare_feature_ingestion(df, entity_id, feature_names, feature_versions=Non
285
285
  logger_safe("debug", "nested_query=%s", nested_query)
286
286
 
287
287
  # Execute: create volatile table and test unicity
288
+ query_create_volatile = f"""
289
+ CREATE VOLATILE TABLE {volatile_table_name} AS
290
+ (
291
+ {nested_query}
292
+ ) WITH DATA
293
+ PRIMARY INDEX ({primary_index})
294
+ ON COMMIT PRESERVE ROWS
295
+ """
288
296
  try:
297
+ tdml.execute_sql(f"DROP TABLE {_get_database_username()}.{volatile_table_name}")
298
+ logger_safe('info', 'drop volatile table')
299
+ except Exception as e:
300
+ logger_safe('info', 'volatile table does not exists yet')
301
+
302
+ try:
303
+ tdml.execute_sql(query_create_volatile)
304
+ logger_safe('info', 'results calculated and materialized in a volatile table')
305
+ except Exception as e:
306
+ logger_safe('error', f"query execution failed : {str(e).split('\n')[0]}")
307
+ raise
308
+
309
+
310
+
311
+ if False:
289
312
  tdml.DataFrame.from_query(nested_query).to_sql(
290
313
  table_name = volatile_table_name,
291
314
  temporary = True,
292
315
  primary_index = primary_index.split(','),
293
316
  if_exists = 'replace'
294
317
  )
318
+ try:
295
319
  nb_duplicates = tdml.execute_sql(query_test_unicity).fetchall()[0][0]
296
320
  if nb_duplicates is not None and nb_duplicates > 0:
297
321
  logger_safe("error", "The process generates %s duplicates", nb_duplicates)
@@ -994,11 +1018,17 @@ def prepare_feature_ingestion_tdstone2(df, entity_id):
994
1018
  {volatile_expression}
995
1019
  """
996
1020
  # Execute the SQL query to create the volatile table.
1021
+ try:
1022
+ tdml.execute_sql(f"DROP TABLE {_get_database_username()}.{volatile_table_name}")
1023
+ except Exception as e:
1024
+ logger_safe('info','the VOLATILE table does not exist and will be created')
1025
+ pass
1026
+
997
1027
  try:
998
1028
  tdml.execute_sql(query)
999
1029
  except Exception as e:
1000
1030
  if tdfs4ds.DISPLAY_LOGS:
1001
- print(str(e).split('\n')[0])
1031
+ logger_safe('debug',str(e).split('\n')[0])
1002
1032
  tdml.execute_sql(f'DELETE {volatile_table_name}')
1003
1033
 
1004
1034
  # Optionally print the query if the display flag is set.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tdfs4ds
3
- Version: 0.2.5.2
3
+ Version: 0.2.5.3
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
@@ -12,6 +12,7 @@ Requires-Dist: plotly
12
12
  Requires-Dist: tqdm
13
13
  Requires-Dist: networkx
14
14
  Requires-Dist: sqlparse
15
+ Requires-Dist: langchain-openai
15
16
 
16
17
  ![tdfs4ds logo](https://github.com/denismolin/tdfs4ds/raw/main/tdfs4ds_logo.png)
17
18
 
@@ -1,4 +1,4 @@
1
- tdfs4ds/__init__.py,sha256=NeD8Lf1HwfqupVOzESCydySlk_TdvlQbJflg7MZTKm8,70555
1
+ tdfs4ds/__init__.py,sha256=muxHRnaQlYzuPAVCPgeVO-951cQNOzB5ogyNPKkIPzs,70555
2
2
  tdfs4ds/datasets.py,sha256=LE4Gn0muwdyrIrCrbkE92cnafUML63z1lj5bFIIVzmc,3524
3
3
  tdfs4ds/data/curves.csv,sha256=q0Tm-0yu7VMK4lHvHpgi1LMeRq0lO5gJy2Q17brKbEM,112488
4
4
  tdfs4ds/data/logo/tdfs4ds_logo.png,sha256=OCKQnH0gQbRyupwZeiIgo-9c6mdRtjE2E2Zunr_4Ae0,363980
@@ -9,7 +9,7 @@ tdfs4ds/dataset/dataset.py,sha256=J_fgfsVdR9zSOXrUOqyotqsUD-GlQMGyuld6ueov45w,76
9
9
  tdfs4ds/dataset/dataset_catalog.py,sha256=qxS2thDW2MvsRouSFaX1M0sX2J7IzBAYD8Yf22Tsd5k,16638
10
10
  tdfs4ds/feature_store/__init__.py,sha256=a7NPCkpTx40UR5LRErwnskpABG2Vuib7F5wUjaUGCnI,209
11
11
  tdfs4ds/feature_store/entity_management.py,sha256=9ltytv3yCTG84NZXBpb1Tlkf9pOxvrNb0MVidU4pwvE,10157
12
- tdfs4ds/feature_store/feature_data_processing.py,sha256=gXBsr1H05zxM4tWE7y29ucxeoTu1jQITOwTXqi1Y2pk,45214
12
+ tdfs4ds/feature_store/feature_data_processing.py,sha256=mC58pmxIeJ7Sdw-IUvx-ToSDa6D6OBRq8MPvbmp33G0,46214
13
13
  tdfs4ds/feature_store/feature_query_retrieval.py,sha256=51c6ZNlLFiBIxNPinS8ot8bjWEIb1QV2eVg69yzVF80,35381
14
14
  tdfs4ds/feature_store/feature_store_management.py,sha256=mtPQkdMDhcOrhj9IAaH-FEP_znK53cYtEv8zXAbsigg,52123
15
15
  tdfs4ds/genai/__init__.py,sha256=Hal13Kw75nDYKHtfvHZNdm98exqmY6qaqGZkJA2TQ6E,723
@@ -26,7 +26,7 @@ tdfs4ds/utils/lineage.py,sha256=gy5M42qy5fvdWmlohAY3WPYoqAyp5VakeEmeT1YjrJQ,3783
26
26
  tdfs4ds/utils/query_management.py,sha256=kWDeTdsYcbpV5Tyhh-8uLRWvXh16nIdXNIJ97w76aNU,4848
27
27
  tdfs4ds/utils/time_management.py,sha256=g3EJO7I8ERoZ4X7yq5SyDqSE4O9p0BRcv__QPuAxbGA,32243
28
28
  tdfs4ds/utils/visualization.py,sha256=5S528KoKzzkrAdCxfy7ecyqKvAXBoibNvHwz_u5ISMs,23167
29
- tdfs4ds-0.2.5.2.dist-info/METADATA,sha256=qADkn9deR_9Yo-IRA5J7VHE1KNcgwL2qNCKFA3DIg_o,14325
30
- tdfs4ds-0.2.5.2.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
31
- tdfs4ds-0.2.5.2.dist-info/top_level.txt,sha256=wMyVkMvnBn8RRt1xBveGQxOpWFijPMPkMiE7G2mi8zo,8
32
- tdfs4ds-0.2.5.2.dist-info/RECORD,,
29
+ tdfs4ds-0.2.5.3.dist-info/METADATA,sha256=YMJ_-zTtblcD2ukiG8Z7VMcoKCARkXF2jZwzluZuinA,14358
30
+ tdfs4ds-0.2.5.3.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
31
+ tdfs4ds-0.2.5.3.dist-info/top_level.txt,sha256=wMyVkMvnBn8RRt1xBveGQxOpWFijPMPkMiE7G2mi8zo,8
32
+ tdfs4ds-0.2.5.3.dist-info/RECORD,,