fix: store reference_column as object with name and type

The protobuf definition expects reference_column to be an object with
name and type fields, but it was being stored as just a string (column
name). This caused pipeline fetching to fail with the error:
".NewTable.reference_column: object expected"

Changes:
- Update ReferenceColumn interface in DynamoDB service
- Update extractTablesFromJobs to create reference_column object
- Update syncJobInputToDynamoDB to handle reference_column object

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Rafael
2025-12-17 13:45:18 -03:00
co-authored by Claude Opus 4.5
parent fb521f53cd
commit e99306adba
2 changed files with 33 additions and 16 deletions
+8 -3
View File
@@ -11,6 +11,11 @@ import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
import { v4 as uuid } from 'uuid';
import { DYNAMODB_CONFIG } from './dynamodb.config';
export interface ReferenceColumn {
name: string;
type: string;
}
export interface InputDocument {
id: string;
client_id: string;
@@ -24,7 +29,7 @@ export interface InputDocument {
name: string;
type: string;
columns?: string[];
reference_column?: string;
reference_column?: ReferenceColumn;
}>;
credentials?: Record<string, any>;
}
@@ -62,7 +67,7 @@ export class DynamoDBService {
name: string;
type: string;
columns?: string[];
reference_column?: string;
reference_column?: ReferenceColumn;
}>;
},
): Promise<InputDocument> {
@@ -157,7 +162,7 @@ export class DynamoDBService {
changes: {
type?: string;
columns?: string[];
reference_column?: string | null;
reference_column?: ReferenceColumn | null;
},
): Promise<void> {
const dynamoTableName = DYNAMODB_CONFIG.inputsTable();