refactor(core): Include native Python option in Code node (#18331)

This commit is contained in:
Iván Ovejero
2025-08-18 12:25:47 +02:00
committed by GitHub
parent adaa1180eb
commit 47cb4a07ca
6 changed files with 146 additions and 48 deletions

View File

@@ -14,12 +14,15 @@ const commonDescription: INodeProperties = {
noDataExpression: true,
};
const PRINT_INSTRUCTION =
'Debug by using <code>print()</code> statements and viewing their output in the browser console.';
export const pythonCodeDescription: INodeProperties[] = [
{
...commonDescription,
displayOptions: {
show: {
language: ['python'],
language: ['python', 'pythonNative'],
mode: ['runOnceForAllItems'],
},
},
@@ -28,14 +31,13 @@ export const pythonCodeDescription: INodeProperties[] = [
...commonDescription,
displayOptions: {
show: {
language: ['python'],
language: ['python', 'pythonNative'],
mode: ['runOnceForEachItem'],
},
},
},
{
displayName:
'Debug by using <code>print()</code> statements and viewing their output in the browser console.',
displayName: PRINT_INSTRUCTION,
name: 'notice',
type: 'notice',
displayOptions: {
@@ -45,4 +47,15 @@ export const pythonCodeDescription: INodeProperties[] = [
},
default: '',
},
{
displayName: `${PRINT_INSTRUCTION}<br><br>The native Python option does not support <code>_</code> syntax and helpers, except for <code>_items</code> and <code>_item</code>.`,
name: 'notice',
type: 'notice',
displayOptions: {
show: {
language: ['pythonNative'],
},
},
default: '',
},
];