mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-15 08:49:08 +00:00
Merge pull request #458 from dadosfera/force-deploy
FIX: rename-tables proxy path and ES lookup
This commit is contained in:
@@ -1066,8 +1066,8 @@ export class PlatformApiController {
|
||||
const rollbackSteps: Array<() => Promise<void>> = [];
|
||||
|
||||
try {
|
||||
const dataAsset = await this.elasticsearchService.findDataAssetByPipelineAndTable(
|
||||
user.customer_name, pipelineId, oldTableName, oldTableSchema,
|
||||
const dataAsset = await this.elasticsearchService.findDataAssetByTable(
|
||||
user.customer_name, oldTableName, oldTableSchema,
|
||||
);
|
||||
|
||||
if (!dataAsset) {
|
||||
|
||||
@@ -362,9 +362,8 @@ export class ElasticsearchService {
|
||||
return `${customerName}_data_assets_catalog`;
|
||||
}
|
||||
|
||||
async findDataAssetByPipelineAndTable(
|
||||
async findDataAssetByTable(
|
||||
customerName: string,
|
||||
pipelineId: string,
|
||||
tableName: string,
|
||||
tableSchema: string,
|
||||
): Promise<{ id: string; nimbus_id: number | null; [key: string]: any } | null> {
|
||||
@@ -372,7 +371,6 @@ export class ElasticsearchService {
|
||||
|
||||
this.logger.info('Elasticsearch: Searching data asset', {
|
||||
index,
|
||||
pipelineId,
|
||||
tableName,
|
||||
tableSchema,
|
||||
});
|
||||
@@ -382,7 +380,6 @@ export class ElasticsearchService {
|
||||
query: {
|
||||
bool: {
|
||||
must: [
|
||||
{ term: { 'pipeline_id.keyword': pipelineId } },
|
||||
{ term: { 'table_name.keyword': tableName } },
|
||||
{ term: { 'table_schema.keyword': tableSchema } },
|
||||
],
|
||||
@@ -393,13 +390,13 @@ export class ElasticsearchService {
|
||||
|
||||
const hits = response.data.hits?.hits || [];
|
||||
if (hits.length === 0) {
|
||||
this.logger.warn('Elasticsearch: Data asset not found', { pipelineId, tableName, tableSchema, index });
|
||||
this.logger.warn('Elasticsearch: Data asset not found', { tableName, tableSchema, index });
|
||||
return null;
|
||||
}
|
||||
|
||||
return { ...hits[0]._source, _es_id: hits[0]._id };
|
||||
} catch (error) {
|
||||
this.handleError('findDataAssetByPipelineAndTable', error, { pipelineId, tableName, tableSchema, index });
|
||||
this.handleError('findDataAssetByTable', error, { tableName, tableSchema, index });
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user