tdfs4ds 0.2.4.25__py3-none-any.whl → 0.2.4.41__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 +586 -564
- tdfs4ds/feature_store/feature_data_processing.py +367 -299
- tdfs4ds/feature_store/feature_query_retrieval.py +105 -52
- tdfs4ds/feature_store/feature_store_management.py +268 -285
- tdfs4ds/process_store/process_followup.py +113 -2
- tdfs4ds/process_store/process_query_administration.py +1 -1
- tdfs4ds/process_store/process_registration_management.py +67 -55
- tdfs4ds/process_store/process_store_catalog_management.py +2 -2
- tdfs4ds/utils/filter_management.py +521 -138
- tdfs4ds/utils/query_management.py +18 -40
- tdfs4ds/utils/time_management.py +547 -97
- {tdfs4ds-0.2.4.25.dist-info → tdfs4ds-0.2.4.41.dist-info}/METADATA +1 -1
- {tdfs4ds-0.2.4.25.dist-info → tdfs4ds-0.2.4.41.dist-info}/RECORD +15 -15
- {tdfs4ds-0.2.4.25.dist-info → tdfs4ds-0.2.4.41.dist-info}/WHEEL +0 -0
- {tdfs4ds-0.2.4.25.dist-info → tdfs4ds-0.2.4.41.dist-info}/top_level.txt +0 -0
|
@@ -84,71 +84,49 @@ def execute_query_wrapper(f):
|
|
|
84
84
|
return wrapped_f
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
def execute_query(query):
|
|
87
|
+
def execute_query(query, raise_error=False):
|
|
88
88
|
"""
|
|
89
89
|
Execute a SQL query or a list of queries using the tdml module.
|
|
90
90
|
|
|
91
|
-
This function checks the version of the tdml module and executes the query or queries accordingly.
|
|
92
|
-
For versions greater than 17.20.00.03, it uses `tdml.execute_sql`; otherwise, it uses `tdml.get_context().execute`.
|
|
93
|
-
|
|
94
91
|
Args:
|
|
95
92
|
query (str or list): A single SQL query string or a list of SQL query strings.
|
|
93
|
+
raise_error (bool): If True, re-raise exceptions after printing them. Default is False.
|
|
96
94
|
|
|
97
95
|
Returns:
|
|
98
96
|
The result of the SQL execution if a single query is passed. None if a list of queries is passed or an exception occurs.
|
|
97
|
+
"""
|
|
98
|
+
def handle_exception(e, q):
|
|
99
|
+
# Always print error
|
|
100
|
+
print(str(e).split('\n')[0])
|
|
101
|
+
print(q)
|
|
99
102
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
To execute a list of SQL queries:
|
|
105
|
-
>>> execute_query(["UPDATE table1 SET column1 = 42", "DELETE FROM table2 WHERE condition"])
|
|
106
|
-
|
|
107
|
-
Note:
|
|
108
|
-
- If a single query is passed, the function returns the result of the SQL execution.
|
|
109
|
-
- If a list of queries is passed, the function executes each query and returns None.
|
|
110
|
-
- If an exception occurs during execution, the error message and the problematic query are printed,
|
|
111
|
-
and the function returns None.
|
|
103
|
+
# Raise exception only if requested
|
|
104
|
+
if raise_error:
|
|
105
|
+
raise e
|
|
112
106
|
|
|
113
|
-
"""
|
|
114
|
-
# Check if the version of tdml is greater than the specified base version
|
|
115
107
|
if is_version_greater_than(tdml.__version__, base_version="17.20.00.03"):
|
|
116
|
-
|
|
117
|
-
if type(query) == list:
|
|
108
|
+
if isinstance(query, list):
|
|
118
109
|
for q in query:
|
|
119
110
|
try:
|
|
120
|
-
tdml.execute_sql(q)
|
|
111
|
+
tdml.execute_sql(q)
|
|
121
112
|
except Exception as e:
|
|
122
|
-
|
|
123
|
-
print(str(e).split('\n')[0])
|
|
124
|
-
print(q)
|
|
113
|
+
handle_exception(e, q)
|
|
125
114
|
else:
|
|
126
|
-
# If query is not a list, execute it and return the result
|
|
127
115
|
try:
|
|
128
116
|
return tdml.execute_sql(query)
|
|
129
117
|
except Exception as e:
|
|
130
|
-
|
|
131
|
-
print(str(e).split('\n')[0])
|
|
132
|
-
print(query)
|
|
118
|
+
handle_exception(e, query)
|
|
133
119
|
else:
|
|
134
|
-
|
|
135
|
-
if type(query) == list:
|
|
120
|
+
if isinstance(query, list):
|
|
136
121
|
for q in query:
|
|
137
122
|
try:
|
|
138
|
-
# Use the older execution method for the query
|
|
139
123
|
tdml.get_context().execute(q)
|
|
140
124
|
except Exception as e:
|
|
141
|
-
|
|
142
|
-
print(str(e).split('\n')[0])
|
|
143
|
-
print(q)
|
|
125
|
+
handle_exception(e, q)
|
|
144
126
|
else:
|
|
145
127
|
try:
|
|
146
|
-
# Execute the single query using the older method and return the result
|
|
147
128
|
return tdml.get_context().execute(query)
|
|
148
129
|
except Exception as e:
|
|
149
|
-
|
|
150
|
-
print(str(e).split('\n')[0])
|
|
151
|
-
print(query)
|
|
130
|
+
handle_exception(e, query)
|
|
152
131
|
|
|
153
|
-
|
|
154
|
-
return
|
|
132
|
+
return None
|