|
108 | 108 |
|
109 | 109 | <div class="d-flex"> |
110 | 110 | <v-spacer></v-spacer> |
111 | | - <v-btn width="100" small class="primaryLightBtn" color="primaryLight" @click="runTransformationFunction"> |
| 111 | + <v-btn width="100" small class="primaryLightBtn" color="primaryLight" @click="runTransformationFunction" :loading="isTransformationFunctionRunning"> |
112 | 112 | Run |
113 | 113 | </v-btn> |
114 | 114 | </div> |
@@ -182,6 +182,7 @@ const transformationResult = ref<FunctionInputDTO | null>(null); |
182 | 182 | const selectedDataset = ref<string | null>(null); |
183 | 183 | const selectedColumn = ref<string | null>(null); |
184 | 184 | let transformationArguments = ref<{ [name: string]: FunctionInputDTO }>({}) |
| 185 | +const isTransformationFunctionRunning = ref<boolean>(false); |
185 | 186 |
|
186 | 187 | const monacoOptions: IEditorOptions = inject('monacoOptions'); |
187 | 188 | const panel = ref<number[]>([0]); |
@@ -222,27 +223,33 @@ onActivated(async () => { |
222 | 223 | }); |
223 | 224 |
|
224 | 225 | async function runTransformationFunction() { |
225 | | - const params = Object.values(transformationArguments.value); |
226 | | - if (selected.value!.cellLevel) { |
227 | | - params.push({ |
228 | | - isAlias: false, |
229 | | - name: 'column_name', |
230 | | - params: [], |
231 | | - type: 'str', |
232 | | - value: selectedColumn.value |
233 | | - }) |
| 226 | + isTransformationFunctionRunning.value = true; |
| 227 | + try { |
| 228 | + const params = Object.values(transformationArguments.value); |
| 229 | + if (selected.value!.cellLevel) { |
| 230 | + params.push({ |
| 231 | + isAlias: false, |
| 232 | + name: 'column_name', |
| 233 | + params: [], |
| 234 | + type: 'str', |
| 235 | + value: selectedColumn.value |
| 236 | + }) |
| 237 | + } |
| 238 | +
|
| 239 | + mixpanel.track("Run transformation function from Catalog", { |
| 240 | + transformationFunctionName: selected.value!.name, |
| 241 | + inputs: anonymize(params), |
| 242 | + }); |
| 243 | +
|
| 244 | + transformationResult.value = await api.datasetProcessing(props.projectId, selectedDataset.value!, [{ |
| 245 | + uuid: selected.value!.uuid, |
| 246 | + params, |
| 247 | + type: 'TRANSFORMATION' |
| 248 | + }]); |
| 249 | + } |
| 250 | + finally { |
| 251 | + isTransformationFunctionRunning.value = false; |
234 | 252 | } |
235 | | -
|
236 | | - mixpanel.track("Run transformation function from Catalog", { |
237 | | - transformationFunctionName: selected.value!.name, |
238 | | - inputs: anonymize(params), |
239 | | - }); |
240 | | -
|
241 | | - transformationResult.value = await api.datasetProcessing(props.projectId, selectedDataset.value!, [{ |
242 | | - uuid: selected.value!.uuid, |
243 | | - params, |
244 | | - type: 'TRANSFORMATION' |
245 | | - }]); |
246 | 253 | } |
247 | 254 |
|
248 | 255 | watch(() => selected.value, () => { |
|
0 commit comments