Skip to content

Commit

Permalink
fix(bq) SETUP dependencies (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoizueta authored Oct 27, 2023
1 parent 9ffb54d commit 3d159b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clouds/bigquery/common/build_modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ functionsFilter.forEach(f => {
if (!nodeps) {
functions.forEach(mainFunction => {
functions.forEach(depFunction => {
if (mainFunction.name != depFunction.name && depFunction.name !== 'SETUP') {
if (mainFunction.name != depFunction.name) {
const depFunctionMatches = [];
depFunctionMatches.push(...depFunction.content.replace(/(\r\n|\n|\r)/gm,' ').matchAll(new RegExp('(?<=(?<!TEMP )FUNCTION)(.*?)(?=AS |RETURNS)','g')));
depFunctionMatches.push(...depFunction.content.replace(/(\r\n|\n|\r)/gm,' ').matchAll(new RegExp('(?<=PROCEDURE)(.*?)(?=BEGIN)','g')));
Expand All @@ -109,7 +109,7 @@ if (!nodeps) {
qualifiedDepFunctName = qualifiedDepFunctName.split('.');
depFunctionNames.push(qualifiedDepFunctName[qualifiedDepFunctName.length - 1]);
})
if (depFunctionNames.some((depFunctionName) => mainFunction.content.includes(`DATASET@@.${depFunctionName}`))) {
if (depFunctionNames.some((depFunctionName) => mainFunction.content.includes(`DATASET@@.${depFunctionName}\`(`))) {
mainFunction.dependencies.push(depFunction.name);
}
}
Expand Down

0 comments on commit 3d159b1

Please sign in to comment.