ga4-export-fixer 0.5.2-dev.5 → 0.5.2-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -128,6 +128,20 @@ const generateItemRevenueAssertionSql = (tableRef, config) => {
|
|
|
128
128
|
throw new Error('assertions.itemRevenue: tableRef is required and must be a non-empty string (e.g., ctx.ref(\'table_name\') or \'`project.dataset.table`\').');
|
|
129
129
|
}
|
|
130
130
|
const mergedConfig = utils.mergeSQLConfigurations(defaultConfig, config);
|
|
131
|
+
|
|
132
|
+
// The assertion interpolates sourceTable directly into SQL (no Dataform ctx available).
|
|
133
|
+
// If sourceTable is still a Dataform reference object, it would render as [object Object].
|
|
134
|
+
if (utils.isDataformTableReferenceObject(mergedConfig.sourceTable)) {
|
|
135
|
+
throw new Error(
|
|
136
|
+
'assertions.itemRevenue: config.sourceTable is a Dataform table reference object, but assertions do not have access to Dataform context to resolve it. ' +
|
|
137
|
+
'Resolve it with ctx.ref() before passing it to the assertion:\n\n' +
|
|
138
|
+
' .query(ctx => ga4EventsEnhanced.assertions.itemRevenue(\n' +
|
|
139
|
+
' ctx.ref(\'enhanced_table_name\'),\n' +
|
|
140
|
+
' { ...config, sourceTable: ctx.ref(config.sourceTable) }\n' +
|
|
141
|
+
' ))'
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
131
145
|
validateEnhancedEventsConfig(mergedConfig, { skipDataformContextFields: true });
|
|
132
146
|
return _generateItemRevenueAssertionSql(tableRef, mergedConfig);
|
|
133
147
|
};
|