tdfs4ds 0.2.5.1__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 +1 -1
- tdfs4ds/feature_store/feature_data_processing.py +31 -1
- tdfs4ds/genai/documentation.py +2 -2
- {tdfs4ds-0.2.5.1.dist-info → tdfs4ds-0.2.5.3.dist-info}/METADATA +2 -1
- {tdfs4ds-0.2.5.1.dist-info → tdfs4ds-0.2.5.3.dist-info}/RECORD +7 -7
- {tdfs4ds-0.2.5.1.dist-info → tdfs4ds-0.2.5.3.dist-info}/WHEEL +0 -0
- {tdfs4ds-0.2.5.1.dist-info → tdfs4ds-0.2.5.3.dist-info}/top_level.txt +0 -0
tdfs4ds/__init__.py
CHANGED
|
@@ -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
|
-
|
|
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.
|
tdfs4ds/genai/documentation.py
CHANGED
|
@@ -327,14 +327,14 @@ def _print_documentation(
|
|
|
327
327
|
explain_section += f'<div style="{HTML_STYLES["content"]}">{explain_text_html}</div>'
|
|
328
328
|
|
|
329
329
|
if warn_list:
|
|
330
|
-
warnings_html = '\n'.join(f'<li style="color: #c0392b;">{_md_to_html(w).replace(newline,
|
|
330
|
+
warnings_html = '\n'.join(f'<li style="color: #c0392b;">{_md_to_html(w).replace(newline,"<br>")}</li>' for w in warn_list)
|
|
331
331
|
explain_section += f"""
|
|
332
332
|
<h4 style="color: #c0392b; margin-top: 10px;">⚠ Warnings</h4>
|
|
333
333
|
<ul style="{HTML_STYLES['list']}">{warnings_html}</ul>
|
|
334
334
|
"""
|
|
335
335
|
|
|
336
336
|
if rec_list:
|
|
337
|
-
recommendations_html = '\n'.join(f'<li style="color: #27ae60;">{_md_to_html(r).replace(newline,
|
|
337
|
+
recommendations_html = '\n'.join(f'<li style="color: #27ae60;">{_md_to_html(r).replace(newline,"<br>")}</li>' for r in rec_list)
|
|
338
338
|
explain_section += f"""
|
|
339
339
|
<h4 style="color: #27ae60; margin-top: 10px;">✓ Recommendations</h4>
|
|
340
340
|
<ul style="{HTML_STYLES['list']}">{recommendations_html}</ul>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tdfs4ds
|
|
3
|
-
Version: 0.2.5.
|
|
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
|

|
|
17
18
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
tdfs4ds/__init__.py,sha256=
|
|
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,11 +9,11 @@ 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=
|
|
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
|
|
16
|
-
tdfs4ds/genai/documentation.py,sha256=
|
|
16
|
+
tdfs4ds/genai/documentation.py,sha256=9BOqV7F4XVBDF8SYU6W8TRsRnDvIxR8CV4bauVimSe0,82056
|
|
17
17
|
tdfs4ds/process_store/__init__.py,sha256=npHR_xju5ecGmWfYHDyteLwiU3x-cL4HD3sFK_th7xY,229
|
|
18
18
|
tdfs4ds/process_store/process_followup.py,sha256=E4jgQahjhVRBbfAW3JXNLId7H5qV8ozRt-6PyAQuPzg,12583
|
|
19
19
|
tdfs4ds/process_store/process_query_administration.py,sha256=AOufkJ6DFUpBiGm-6Q6Dq0Aovw31UGTscZ3Ya0ewS-0,7851
|
|
@@ -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.
|
|
30
|
-
tdfs4ds-0.2.5.
|
|
31
|
-
tdfs4ds-0.2.5.
|
|
32
|
-
tdfs4ds-0.2.5.
|
|
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,,
|
|
File without changes
|
|
File without changes
|