mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-21 23:48:47 +00:00
Fix: issue-4220: Airflow throwing error while deploying ingestion dags to airflow (#4229)
This commit is contained in:
parent
0abe8f540b
commit
dd2ccb1a89
@ -11,7 +11,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { isUndefined } from 'lodash';
|
||||
import { isEmpty, isUndefined } from 'lodash';
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
INGESTION_SCHEDULER_INITIAL_VALUE,
|
||||
@ -214,19 +214,23 @@ const AddIngestion = ({
|
||||
const getFilterPatternData = (data: FilterPattern) => {
|
||||
const { includes, excludes } = data;
|
||||
|
||||
return isUndefined(includes) && isUndefined(excludes)
|
||||
? undefined
|
||||
: {
|
||||
includes: includes && includes.length > 0 ? includes : undefined,
|
||||
excludes: excludes && excludes.length > 0 ? excludes : undefined,
|
||||
};
|
||||
const filterPattern =
|
||||
(!isUndefined(includes) && includes.length) ||
|
||||
(!isUndefined(excludes) && excludes.length)
|
||||
? {
|
||||
includes: includes && includes.length > 0 ? includes : undefined,
|
||||
excludes: excludes && excludes.length > 0 ? excludes : undefined,
|
||||
}
|
||||
: undefined;
|
||||
|
||||
return filterPattern;
|
||||
};
|
||||
|
||||
const createNewIngestion = () => {
|
||||
const ingestionDetails: CreateIngestionPipeline = {
|
||||
airflowConfig: {
|
||||
startDate: startDate as unknown as Date,
|
||||
endDate: endDate as unknown as Date,
|
||||
endDate: isEmpty(endDate) ? undefined : (endDate as unknown as Date),
|
||||
scheduleInterval: repeatFrequency,
|
||||
forceDeploy: true,
|
||||
},
|
||||
|
@ -55,6 +55,8 @@ const jsonData = {
|
||||
|
||||
'triggering-ingestion-error': 'Error while triggering ingestion workflow',
|
||||
|
||||
'deploy-ingestion-error': 'Error while deploying ingestion workflow!',
|
||||
|
||||
'fetch-auth-config-error': 'Error occurred while fetching auth configs!',
|
||||
'fetch-chart-error': 'Error while fetching charts!',
|
||||
'fetch-dashboard-details-error': 'Error while fetching dashboard details!',
|
||||
@ -142,6 +144,7 @@ const jsonData = {
|
||||
},
|
||||
message: {
|
||||
'no-services': 'No services',
|
||||
'fail-to-deploy-pipeline': 'Failed to deploy Ingestion Pipeline',
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -22,6 +22,7 @@ import { ServiceCategory } from '../../enums/service.enum';
|
||||
import { CreateIngestionPipeline } from '../../generated/api/services/ingestionPipelines/createIngestionPipeline';
|
||||
import { DataObj } from '../../interface/service.interface';
|
||||
import jsonData from '../../jsons/en';
|
||||
import { getErrorText } from '../../utils/StringsUtils';
|
||||
import { showErrorToast } from '../../utils/ToastUtils';
|
||||
|
||||
const AddServicePage = () => {
|
||||
@ -66,11 +67,25 @@ const AddServicePage = () => {
|
||||
}
|
||||
})
|
||||
.catch((err: AxiosError) => {
|
||||
showErrorToast(
|
||||
const errMessage = getErrorText(
|
||||
err,
|
||||
jsonData['api-error-messages']['create-ingestion-error']
|
||||
);
|
||||
reject();
|
||||
if (
|
||||
errMessage.includes(jsonData['message']['fail-to-deploy-pipeline'])
|
||||
) {
|
||||
showErrorToast(
|
||||
errMessage,
|
||||
jsonData['api-error-messages']['deploy-ingestion-error']
|
||||
);
|
||||
resolve();
|
||||
} else {
|
||||
showErrorToast(
|
||||
err,
|
||||
jsonData['api-error-messages']['create-ingestion-error']
|
||||
);
|
||||
reject();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -420,10 +420,18 @@ const ServicePage: FunctionComponent = () => {
|
||||
);
|
||||
if (message.includes('Connection refused')) {
|
||||
setConnectionAvailable(false);
|
||||
} else if (
|
||||
message.includes(jsonData['message']['fail-to-deploy-pipeline'])
|
||||
) {
|
||||
showErrorToast(
|
||||
message,
|
||||
jsonData['api-error-messages']['deploy-ingestion-error']
|
||||
);
|
||||
resolve();
|
||||
} else {
|
||||
showErrorToast(message);
|
||||
reject();
|
||||
}
|
||||
reject();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user