Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,6 @@ describe('COMPLETION Validation', () => {
});

describe('a custom targetField is provided', () => {
it('targetField is not available before COMPLETION', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can't be tested here now, as the general validation routine is still in validation-autocomplete package.

Copy link
Copy Markdown
Contributor

@stratoula stratoula Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this test used to run and stopped working due to this change? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It made sense when the validation routine was run from validation-autocomplete, now it was passing by chance, because we were checking the unknown columns before pushing the new one.

completionExpectErrors(
`FROM index | KEEP customField | COMPLETION customField = "prompt" WITH inferenceId`,
['Unknown column [customField]']
);
});

it('targetField is available after COMPLETION', () => {
completionExpectErrors(
`FROM index | COMPLETION keywordField = "prompt" WITH inferenceId | KEEP keywordField`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export const validate = (
});
}

messages.push(...validateCommandArguments(command, ast, context, callbacks));

const targetName = targetField?.name || 'completion';

// Sets the target field so the column is recognized after the command is applied
Expand All @@ -56,5 +54,7 @@ export const validate = (
},
]);

messages.push(...validateCommandArguments(command, ast, context, callbacks));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix makes sense yes 👍


return messages;
};