Merge pull request #458 from dadosfera/force-deploy

FIX: rename-tables proxy path and ES lookup
This commit is contained in:
Rafael Santana
2026-03-13 18:29:53 -03:00
committed by GitHub
2 changed files with 5 additions and 8 deletions
@@ -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;
}
}