├── .coveragerc ├── .gitattributes ├── .gitignore ├── .lfsconfig ├── .mvn └── extensions.xml ├── .project ├── .readthedocs.yaml ├── .settings └── org.eclipse.core.resources.prefs ├── Jenkinsfile ├── LICENSE.txt ├── README.md ├── asvs.md ├── bitbucket-pipelines.yml ├── conftest.py ├── doc ├── KNIME_Logo.png ├── KNIME_Logo.svg ├── Makefile ├── _static │ ├── css │ │ └── custom.css │ └── js │ │ └── redirect.js ├── _templates │ └── layout.html ├── conf.py ├── deprecated-script-api.rst ├── extension-development.rst ├── index.rst ├── license.rst ├── license_input.txt ├── make.bat ├── requirements.txt └── script-api.rst ├── junit-tests ├── README.md ├── env_py39.yml └── setup-Linux.sh ├── knime-extension ├── .gitignore ├── LICENSE.TXT ├── README.md ├── collect_files.py ├── pyproject.toml └── recipe │ ├── meta.yaml │ ├── node_with_test.py │ └── test │ ├── knime │ └── types │ │ └── chemistry.py │ └── plugin.xml ├── org.knime.ext.py4j ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── lib │ ├── LICENSE.txt │ ├── README.txt │ └── py4j-0.10.9.2.jar └── src │ └── main │ └── java │ └── org │ └── knime │ └── ext │ └── py4j │ └── Activator.java ├── org.knime.features.python3.nodes ├── .project ├── .settings │ └── org.eclipse.core.resources.prefs ├── build.properties └── feature.xml ├── org.knime.features.python3.scripting ├── .project ├── .settings │ └── org.eclipse.core.resources.prefs ├── build.properties └── feature.xml ├── org.knime.python3.arrow.tests ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── pom.xml └── src │ └── test │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ └── arrow │ │ ├── JavaToPythonTypeTest.java │ │ ├── KnimeTableTest.java │ │ ├── PythonArrowDataUtilsTest.java │ │ ├── PythonDomainCalculationTest.java │ │ ├── PythonRowKeyCheckingTest.java │ │ ├── PythonToJavaTypeTest.java │ │ └── TestUtils.java │ └── python │ ├── tests_launcher.py │ └── unittest │ ├── 5kDictEncodedChunkedGeospatials.zip │ ├── DictEncString.zip │ ├── GeoWithDateTime.zip │ ├── Lists.zip │ ├── dates.zip │ ├── dict_enc_fs_location.zip │ ├── generatedTestData.zip │ ├── geospatial_table_3.zip │ ├── missingTestData.zip │ ├── rdkit.zip │ ├── test_arrow_backend.py │ ├── test_chemistry_types.py │ ├── test_deprecated_table_api.py │ ├── test_extension_arrays.py │ ├── test_extension_types.py │ ├── test_geo_types.py │ ├── test_pandas_extension_type.py │ ├── test_table.py │ ├── test_types.py │ └── testing_utility.py ├── org.knime.python3.arrow.types.tests ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── pom.xml └── src │ └── test │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ └── arrow │ │ └── types │ │ └── KnimeArrowExtensionTypesTest.java │ └── python │ └── extension_tests_launcher.py ├── org.knime.python3.arrow.types ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.xml └── src │ └── main │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ └── arrow │ │ └── types │ │ └── Python3ArrowTypesSourceDirectory.java │ └── python │ └── knime │ └── types │ ├── builtin.py │ └── tool.py ├── org.knime.python3.arrow ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties └── src │ └── main │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ └── arrow │ │ ├── AbstractAsyncBatchProcessor.java │ │ ├── CancelableExecutor.java │ │ ├── DefaultPythonArrowDataSink.java │ │ ├── DefaultValueFactories.java │ │ ├── DomainCalculator.java │ │ ├── Python3ArrowSourceDirectory.java │ │ ├── PythonArrowDataSink.java │ │ ├── PythonArrowDataSource.java │ │ ├── PythonArrowDataSourceFactory.java │ │ ├── PythonArrowDataUtils.java │ │ ├── PythonArrowExtension.java │ │ ├── PythonArrowTableConverter.java │ │ ├── PythonColumnarSchemaBuilder.java │ │ ├── RandomAccessAsSequentialBatchReadable.java │ │ ├── RowKeyChecker.java │ │ └── SinkManager.java │ └── python │ └── knime │ └── _arrow │ ├── __init__.py │ ├── _backend.py │ ├── _dictencoding.py │ ├── _pandas.py │ ├── _table.py │ ├── _types.py │ └── _utils.py ├── org.knime.python3.nodes.py4j.dependencies ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF └── build.properties ├── org.knime.python3.nodes.tests ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── fragment.xml ├── pom.xml └── src │ └── test │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ └── nodes │ │ ├── CachedObjectTest.java │ │ ├── PythonNodeTestUtils.java │ │ ├── modules │ │ └── PythonNodesModule.java │ │ ├── ports │ │ ├── ImageOutputPortTest.java │ │ └── extension │ │ │ └── ClassHierarchyMapTest.java │ │ └── settings │ │ ├── JsonNodeSettingsTest.java │ │ └── JsonTestUtils.java │ ├── python │ ├── __init__.py │ └── unittest │ │ ├── generatedTestData.zip │ │ ├── mock_extension.py │ │ ├── python_node_description_test.py │ │ ├── test_dialog_rules.py │ │ ├── test_environment_setting.py │ │ ├── test_fluent_node_api.py │ │ ├── test_knime_node_backend.py │ │ ├── test_knime_node_table.py │ │ ├── test_knime_parameter.py │ │ ├── test_port_groups.py │ │ ├── test_ports.py │ │ └── test_utilities.py │ └── resources │ └── test_png.png ├── org.knime.python3.nodes ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── documentation-files │ └── basic.zip ├── plugin.xml ├── schema │ └── PythonExtension.exsd └── src │ └── main │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ └── nodes │ │ ├── Activator.java │ │ ├── CachedNodeProxyProvider.java │ │ ├── CachedObject.java │ │ ├── CloseablePythonNodeProxy.java │ │ ├── CloseablePythonNodeProxyFactory.java │ │ ├── DefaultLogCallback.java │ │ ├── DefaultViewCallback.java │ │ ├── DefaultViewContext.java │ │ ├── DelegatingNodeModel.java │ │ ├── KnimeNodeBackend.java │ │ ├── LogCallback.java │ │ ├── PortObjectExtensionPointUtils.java │ │ ├── PurePythonExtensionNodeProxyProvider.java │ │ ├── PurePythonNodeSetFactory.java │ │ ├── PythonExtensionInfoCacheCleaner.java │ │ ├── PythonExtensionParser.java │ │ ├── PythonExtensionPreferences.java │ │ ├── PythonExtensionRegistry.java │ │ ├── PythonNode.java │ │ ├── PythonNodeClass.java │ │ ├── PythonNodeExtension.java │ │ ├── PythonNodeGatewayFactory.java │ │ ├── PythonNodeRuntimeException.java │ │ ├── PythonNodesSourceDirectory.java │ │ ├── ToolExecutor.java │ │ ├── callback │ │ ├── AuthCallback.java │ │ └── AuthCallbackUtils.java │ │ ├── dialog │ │ ├── DelegatingJsonSettingsDataService.java │ │ └── JsonFormsNodeDialog.java │ │ ├── extension │ │ ├── ExtensionKaiNodeInterface.java │ │ ├── ExtensionNode.java │ │ ├── ExtensionNodeSetFactory.java │ │ ├── KnimeExtension.java │ │ ├── NodeDescriptionBuilder.java │ │ └── NodeId.java │ │ ├── ports │ │ ├── PortObjectSpecUtils.java │ │ ├── PythonBinaryBlobFileStorePortObject.java │ │ ├── PythonBinaryBlobPortObjectSpec.java │ │ ├── PythonHubAuthenticationPortObject.java │ │ ├── PythonHubAuthenticationPortObjectSpec.java │ │ ├── PythonPortObjects.java │ │ ├── PythonPortTypeRegistry.java │ │ ├── PythonTransientConnectionPortObject.java │ │ ├── PythonTransientConnectionPortObjectSpec.java │ │ ├── PythonWorkflowPortObject.java │ │ ├── TableSpecSerializationUtils.java │ │ ├── WorkflowExecutionException.java │ │ ├── converters │ │ │ ├── JsonConverterUtils.java │ │ │ ├── PortObjectConversionContext.java │ │ │ ├── PortObjectConverterInterfaces.java │ │ │ ├── PortObjectConverters.java │ │ │ ├── PortObjectSpecConverterInterfaces.java │ │ │ ├── PortObjectSpecConverters.java │ │ │ └── credentials │ │ │ │ ├── CredentialPythonConverter.java │ │ │ │ └── HubCredentialPythonConverter.java │ │ └── extension │ │ │ ├── ClassHierarchyMap.java │ │ │ ├── ExtensionPortObject.java │ │ │ ├── ExtensionPortObjectConverterRegistry.java │ │ │ ├── ExtensionPortObjectConverters.java │ │ │ └── ExtensionPortObjectSpec.java │ │ ├── preferences │ │ └── PythonExtensionsPreferencePage.java │ │ ├── proxy │ │ ├── CloseableNodeFactoryProxy.java │ │ ├── NodeDialogProxy.java │ │ ├── NodeFactoryProxy.java │ │ ├── NodeProxy.java │ │ ├── NodeProxyProvider.java │ │ ├── NodeViewProxy.java │ │ ├── PythonNodeDialogProxy.java │ │ ├── PythonNodeModelProxy.java │ │ ├── PythonNodeProxy.java │ │ ├── PythonNodeViewProxy.java │ │ ├── PythonToolContext.java │ │ ├── VersionedProxy.java │ │ └── model │ │ │ ├── NodeConfigurationProxy.java │ │ │ ├── NodeExecutionProxy.java │ │ │ ├── NodeModelProxy.java │ │ │ └── NodeModelProxyProvider.java │ │ └── settings │ │ ├── JsonNodeSettings.java │ │ └── JsonNodeSettingsSchema.java │ └── python │ ├── _node_backend_launcher.py │ ├── _port_impl.py │ ├── _ports.py │ ├── knime │ └── extension │ │ ├── __init__.py │ │ ├── _markdown.py │ │ ├── env.py │ │ ├── nodes.py │ │ ├── parameter.py │ │ ├── ports.py │ │ ├── testing.py │ │ └── version.py │ ├── knime_extension.py │ ├── knime_node.py │ ├── knime_node_arrow_table.py │ ├── knime_node_table.py │ └── knime_parameter.py ├── org.knime.python3.scripting.nodes.tests ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── pom.xml └── src │ └── test │ └── java │ └── org │ └── knime │ └── python3 │ └── scripting │ └── nodes2 │ ├── ConsoleOutputUtilsTest.java │ └── PythonScriptingInputOutputModelUtilsTest.java ├── org.knime.python3.scripting.nodes ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── icons │ └── python.png ├── js-src │ ├── .editorconfig │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── .husky │ │ ├── pre-commit │ │ └── prepare-commit-msg │ ├── .prettierignore │ ├── .prettierrc.json │ ├── .stylelintignore │ ├── .stylelintrc.cjs │ ├── README.md │ ├── index.html │ ├── lint-staged.config.mjs │ ├── package-lock.json │ ├── package.json │ ├── pom.xml │ ├── postcss.config.cjs │ ├── preview.html │ ├── public │ │ └── assets │ │ │ └── plot-placeholder.svg │ ├── src │ │ ├── __mocks__ │ │ │ ├── browser-mock-services.ts │ │ │ ├── executable-options.ts │ │ │ ├── mock-data.ts │ │ │ └── monaco-editor.ts │ │ ├── __tests__ │ │ │ ├── input-completions.test.ts │ │ │ ├── python-scripting-service.test.ts │ │ │ └── store.test.ts │ │ ├── components │ │ │ ├── App.vue │ │ │ ├── EnvironmentSettings.vue │ │ │ ├── LastActionStatus.vue │ │ │ ├── PythonEditorControls.vue │ │ │ ├── PythonViewPreview.vue │ │ │ ├── PythonWorkspace.vue │ │ │ ├── PythonWorkspaceBody.vue │ │ │ ├── PythonWorkspaceHeader.vue │ │ │ └── __tests__ │ │ │ │ ├── App.test.ts │ │ │ │ ├── EnvironmentSettings.test.ts │ │ │ │ ├── PythonEditorControls.test.ts │ │ │ │ ├── PythonViewPreview.test.ts │ │ │ │ ├── PythonWorkspace.test.ts │ │ │ │ ├── PythonWorkspaceBody.test.ts │ │ │ │ └── PythonWorkspaceHeader.test.ts │ │ ├── input-completions.ts │ │ ├── main.ts │ │ ├── python-initial-data-service.ts │ │ ├── python-scripting-service.ts │ │ ├── python-settings-service.ts │ │ ├── store.ts │ │ ├── test-setup │ │ │ └── setup.ts │ │ ├── types │ │ │ └── common.ts │ │ └── vite-env.d.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.node.json │ ├── tsconfig.vitest.json │ └── vite.config.ts ├── plugin.xml ├── python-kernel-tester │ ├── EnvironmentHelper.py │ ├── PythonKernelTester.py │ └── VersionUtils.py ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── knime │ │ │ └── python3 │ │ │ └── scripting │ │ │ ├── nodes │ │ │ ├── AbstractPythonScriptingNodeDialog.java │ │ │ ├── AbstractPythonScriptingNodeModel.java │ │ │ ├── PortsConfigurationUtils.java │ │ │ ├── VariableNamesUtils.java │ │ │ ├── prefs │ │ │ │ ├── AbstractCondaEnvironmentsConfig.java │ │ │ │ ├── AbstractPythonConfigPanel.java │ │ │ │ ├── AbstractPythonConfigsObserver.java │ │ │ │ ├── AbstractPythonEnvironmentConfig.java │ │ │ │ ├── AbstractPythonPreferencePage.java │ │ │ │ ├── BundledCondaEnvironmentConfig.java │ │ │ │ ├── BundledCondaEnvironmentPreferencesPanel.java │ │ │ │ ├── CondaDirectoryPathStatusPanel.java │ │ │ │ ├── CondaEnvironmentConfig.java │ │ │ │ ├── CondaEnvironmentSelectionBox.java │ │ │ │ ├── CondaEnvironmentsConfig.java │ │ │ │ ├── CondaEnvironmentsPreferencePanel.java │ │ │ │ ├── InstallationStatusDisplayPanel.java │ │ │ │ ├── InstallationStatusDisplayPanelWithWarning.java │ │ │ │ ├── LegacyPreferncesUtil.java │ │ │ │ ├── ManualEnvironmentConfig.java │ │ │ │ ├── ManualEnvironmentsConfig.java │ │ │ │ ├── ManualEnvironmentsPreferencePanel.java │ │ │ │ ├── ObservableValue.java │ │ │ │ ├── PreferenceStorage.java │ │ │ │ ├── PreferenceWrappingConfigStorage.java │ │ │ │ ├── Python3ScriptingConfigsObserver.java │ │ │ │ ├── Python3ScriptingPreferencePage.java │ │ │ │ ├── Python3ScriptingPreferences.java │ │ │ │ ├── Python3ScriptingPreferencesInitializer.java │ │ │ │ ├── PythonBundledEnvironmentTypePreferencePanel.java │ │ │ │ ├── PythonConfig.java │ │ │ │ ├── PythonConfigStorage.java │ │ │ │ ├── PythonEnvironmentConfig.java │ │ │ │ ├── PythonEnvironmentType.java │ │ │ │ ├── PythonEnvironmentTypeConfig.java │ │ │ │ ├── PythonEnvironmentsConfig.java │ │ │ │ ├── PythonKernelTester.java │ │ │ │ ├── PythonModuleSpec.java │ │ │ │ ├── PythonPreferenceUtils.java │ │ │ │ └── StatusDisplayingFilePathEditor.java │ │ │ ├── script │ │ │ │ ├── PythonScriptNodeDialog.java │ │ │ │ ├── PythonScriptNodeFactory.java │ │ │ │ ├── PythonScriptNodeFactory.xml │ │ │ │ ├── PythonScriptNodeModel.java │ │ │ │ ├── python.png │ │ │ │ └── python.svg │ │ │ └── view │ │ │ │ ├── PythonViewNodeDialog.java │ │ │ │ ├── PythonViewNodeFactory.java │ │ │ │ ├── PythonViewNodeFactory.xml │ │ │ │ ├── PythonViewNodeModel.java │ │ │ │ ├── python.png │ │ │ │ └── python.svg │ │ │ └── nodes2 │ │ │ ├── ConsoleOutputUtils.java │ │ │ ├── ExecutableSelectionUtils.java │ │ │ ├── PickledObjectDataSource.java │ │ │ ├── PythonCodeAssistant.java │ │ │ ├── PythonIOUtils.java │ │ │ ├── PythonLanguageServer.java │ │ │ ├── PythonNodeFactoryClassMapper.java │ │ │ ├── PythonScriptNodeDefaultScripts.java │ │ │ ├── PythonScriptNodeDialog.java │ │ │ ├── PythonScriptNodeModel.java │ │ │ ├── PythonScriptNodeSettings.java │ │ │ ├── PythonScriptPortsConfiguration.java │ │ │ ├── PythonScriptingEntryPoint.java │ │ │ ├── PythonScriptingInputOutputModelUtils.java │ │ │ ├── PythonScriptingService.java │ │ │ ├── PythonScriptingSession.java │ │ │ ├── PythonScriptingSourceDirectory.java │ │ │ ├── script │ │ │ ├── PythonScriptNodeFactory.java │ │ │ ├── PythonScriptNodeFactory.xml │ │ │ ├── python.png │ │ │ └── python.svg │ │ │ └── view │ │ │ ├── PythonViewNodeFactory.java │ │ │ ├── PythonViewNodeFactory.xml │ │ │ ├── python.png │ │ │ └── python.svg │ │ └── python │ │ ├── _knime_scripting_launcher.py │ │ ├── knime │ │ └── scripting │ │ │ ├── _backend.py │ │ │ ├── _io_containers.py │ │ │ ├── io.py │ │ │ └── jupyter.py │ │ ├── knime_io.py │ │ └── knime_jupyter.py └── templates │ ├── python3-script │ ├── Working with a pandas.DataFrame.xml │ ├── Working with a pyarrow.Table.xml │ ├── Working with batches (pandas.DataFrame).xml │ └── Working with batches (pyarrow.RecordBatch).xml │ └── python3-view │ ├── Viewing a JPEG image.xml │ ├── Viewing a PNG image.xml │ ├── Viewing a matplotlib plot.xml │ ├── Viewing a network with pyvis.xml │ ├── Viewing a plotly plot.xml │ ├── Viewing a shapely geometry object.xml │ └── Viewing an HTML page.xml ├── org.knime.python3.scripting.py4j.dependencies ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF └── build.properties ├── org.knime.python3.scripting.tests ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ ├── org.sonar.ide.eclipse.core.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── pom.xml └── src │ └── test │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ └── scripting │ │ ├── Python3KernelBackendProxyTest.java │ │ └── PythonTestResult.java │ └── python │ ├── knime_kernel_test.py │ ├── knime_testing.py │ └── unittest │ ├── test_autocompletion.py │ └── test_knime_scripting_io.py ├── org.knime.python3.scripting ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.xml └── src │ └── main │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ └── scripting │ │ ├── Python3KernelBackend.java │ │ ├── Python3KernelBackendFactory.java │ │ ├── Python3KernelBackendProxy.java │ │ └── Python3ScriptingSourceDirectory.java │ └── python │ ├── _kernel_launcher.py │ ├── autocompletion_utils.py │ ├── knime │ └── scripting │ │ ├── _io_containers.py │ │ ├── io.py │ │ └── jupyter.py │ ├── knime_io.py │ └── knime_jupyter.py ├── org.knime.python3.testing ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties └── src │ └── main │ └── java │ └── org │ └── knime │ └── python3 │ └── testing │ ├── Python3ArrowTestUtils.java │ └── Python3TestUtils.java ├── org.knime.python3.tests ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── pom.xml └── src │ └── test │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ ├── AsyncLineRedirectorTest.java │ │ ├── DefaultPythonGatewayTest.java │ │ ├── PythonGatewayCreationGateTest.java │ │ ├── PythonGatewayQueueTest.java │ │ ├── PythonGatewayTrackerTest.java │ │ ├── SingleClientInputStreamSupplierTest.java │ │ └── StoppableInputStreamTest.java │ └── python │ ├── broken_extension.py │ ├── broken_launcher.py │ ├── chatty_launcher.py │ ├── dummy_launcher.py │ ├── printing_launcher.py │ └── unittest │ ├── schema.json │ ├── test_data_source_sink_mapping.py │ ├── test_knime_schema.py │ ├── test_knime_types.py │ └── testing_module.py ├── org.knime.python3.views.tests └── src │ └── main │ └── python │ ├── .gitignore │ ├── examples.py │ ├── pythonpath.py │ └── unittest │ ├── small.jpeg │ ├── small.png │ └── test_knime_views.py ├── org.knime.python3.views ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── build.xml ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ └── views │ │ ├── FolderViewResources.java │ │ ├── HtmlFileNodeView.java │ │ ├── JsonRpcWildcardHandler.java │ │ ├── Python3ViewsSourceDirectory.java │ │ ├── PythonNodeViewSink.java │ │ ├── PythonViewsExtension.java │ │ └── ViewResources.java │ └── python │ ├── knime │ ├── _views.py │ └── api │ │ ├── plotly-post-script.js │ │ └── views.py │ └── knime_views.py ├── org.knime.python3 ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ ├── org.eclipse.pde.api.tools.prefs │ └── org.sonarlint.eclipse.core.prefs ├── LICENSE.TXT ├── META-INF │ └── MANIFEST.MF ├── build.properties └── src │ └── main │ ├── java │ └── org │ │ └── knime │ │ └── python3 │ │ ├── AbstractCondaPythonCommand.java │ │ ├── AbstractPythonCommand.java │ │ ├── Activator.java │ │ ├── AsyncLineRedirector.java │ │ ├── BundledPythonCommand.java │ │ ├── CondaPythonCommand.java │ │ ├── DefaultPythonGateway.java │ │ ├── FreshPythonGatewayFactory.java │ │ ├── Python3SourceDirectory.java │ │ ├── PythonCaCertsMode.java │ │ ├── PythonCommand.java │ │ ├── PythonDataSink.java │ │ ├── PythonDataSource.java │ │ ├── PythonEntryPoint.java │ │ ├── PythonEntryPointUtils.java │ │ ├── PythonException.java │ │ ├── PythonExtension.java │ │ ├── PythonFileStoreUtils.java │ │ ├── PythonGateway.java │ │ ├── PythonGatewayCreationGate.java │ │ ├── PythonGatewayFactory.java │ │ ├── PythonGatewayTracker.java │ │ ├── PythonGatewayUtils.java │ │ ├── PythonPath.java │ │ ├── PythonProcessTerminatedException.java │ │ ├── PythonSourceDirectoryLocator.java │ │ ├── PythonTableDataSource.java │ │ ├── QueuedPythonGatewayFactory.java │ │ ├── SimplePythonCommand.java │ │ ├── SingleClientInputStreamSupplier.java │ │ ├── StoppableInputStream.java │ │ └── utils │ │ ├── AutoCloser.java │ │ ├── FlowVariableUtils.java │ │ └── ProxyUtils.java │ └── python │ ├── LICENSE_DATACLASSES_PY36BACKPORT.txt │ ├── dataclasses_py36backport.py │ ├── debug_util.py │ ├── knime │ ├── _backend │ │ ├── __init__.py │ │ ├── _gateway.py │ │ └── _mainloop.py │ ├── api │ │ ├── env.py │ │ ├── schema.py │ │ ├── table.py │ │ └── types.py │ └── scripting │ │ └── _deprecated │ │ ├── _arrow_table.py │ │ └── _table.py │ ├── knime_schema.py │ └── knime_types.py ├── org.knime.update.python ├── .project ├── .settings │ └── org.eclipse.m2e.core.prefs ├── category.xml └── pom.xml ├── pom.xml ├── pytest-envs ├── README.md ├── env_py311.yml ├── env_py38.yml ├── env_py38_legacy.yml └── env_py39.yml ├── pytest.ini ├── ruff.toml └── workflow-tests ├── README.md ├── env_py36_pa5.yml ├── env_py38_pa7.yml ├── env_py39_kn47.yml ├── preferences-Linux.epf ├── preferences-MacOSX.epf ├── preferences-Windows.epf ├── setup-Linux.sh ├── setup-MacOSX.sh ├── setup-Windows.sh └── vmargs /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | relative_files = True 3 | branch = True 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto !eol 2 | **/.api_filters text diff=xml 3 | **/.classpath text diff=xml 4 | **/.project text diff=xml 5 | **/MANIFEST.MF text 6 | **/build.properties text 7 | **/p2.inf text 8 | *.ai binary filter=lfs diff=lfs merge=lfs 9 | *.bmp binary 10 | *.cspex text diff=xml 11 | *.gif binary 12 | *.html text diff=html 13 | *.ico binary 14 | *.jar binary filter=lfs diff=lfs merge=lfs 15 | *.java text diff=java 16 | *.jpg binary 17 | *.js text 18 | *.json text 19 | *.jsx text 20 | *.png binary 21 | *.prefs text 22 | *.sh text 23 | *.svg text diff=xml 24 | *.xml text diff=xml 25 | *.xsd text diff=xml 26 | *.css text diff=css 27 | *.zip binary filter=lfs diff=lfs merge=lfs 28 | *.pdf binary filter=lfs diff=lfs merge=lfs 29 | *.dll binary filter=lfs diff=lfs merge=lfs 30 | *.so binary filter=lfs diff=lfs merge=lfs 31 | *.dylib binary filter=lfs diff=lfs merge=lfs 32 | *.jsa binary filter=lfs diff=lfs merge=lfs 33 | *.sym binary filter=lfs diff=lfs merge=lfs 34 | *.msi binary filter=lfs diff=lfs merge=lfs 35 | *.tar.gz binary filter=lfs diff=lfs merge=lfs 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | */bin/ 2 | **/target/ 3 | */build/ 4 | *.pyc 5 | *.pydevproject 6 | **/.flattened-pom.xml 7 | */log 8 | */*.jar 9 | **/CHANGELOG.md 10 | 11 | # Sphinx documentation 12 | **/_build/ 13 | 14 | # Coverage.py 15 | .coverage 16 | **/htmlcov/ 17 | **/.idea 18 | **/.vscode 19 | 20 | # new build output 21 | */.polyglot.* 22 | **/.polyglot.build.properties 23 | -------------------------------------------------------------------------------- /.lfsconfig: -------------------------------------------------------------------------------- 1 | [lfs] 2 | url = https://bitbucket.org/KNIME/knime-python.git/info/lfs 3 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | org.eclipse.tycho 5 | tycho-build 6 | 4.0.7 7 | 8 | 9 | com.nuance.clu.maven 10 | maven-feature-branch-extension 11 | 1.2.1.0021-407a3b6 12 | 13 | 14 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | knime-python 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.m2e.core.maven2Builder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Nature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the version of Python and other tools you might need 9 | build: 10 | os: ubuntu-20.04 11 | tools: 12 | python: "3.9" 13 | 14 | # Build documentation in the docs/ directory with Sphinx 15 | sphinx: 16 | configuration: doc/conf.py 17 | 18 | # If using Sphinx, optionally build your docs in additional formats such as PDF 19 | # Build PDF & ePub 20 | formats: 21 | - epub 22 | - pdf 23 | 24 | python: 25 | install: 26 | - requirements: doc/requirements.txt -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | This repository contains parts of the KNIME Analytics Platform as a bundle of various modules. Each module is released under its own license. Please refer to the [project/directory/package] of the module to find it's corresponding license. The KNIME trademark and logo and OPEN FOR INNOVATION are registered in the United States and/or Germany, owned by KNIME GmbH. All other trademarks belong to their respective owners. 2 | -------------------------------------------------------------------------------- /bitbucket-pipelines.yml: -------------------------------------------------------------------------------- 1 | options: 2 | max-time: 30 3 | 4 | definitions: 5 | steps: 6 | - step: &python-format 7 | name: Python format 8 | image: python:3.12 9 | script: 10 | - python -m pip install --upgrade pip 11 | - pip install ruff 12 | - ruff format --check . 13 | - step: &js-lint-test-build 14 | name: JS lint, tests, and build 15 | image: node:22.11.0 # using 22.11.0 because the experimental feature for importing ESM (enabled by default starting with node 22.12.0) significantly slows test execution in the pipeline (https://github.com/vitest-dev/vitest/issues/7302) 16 | caches: 17 | - node 18 | size: 2x # more memory to accomodate docker container for sonarcloud 19 | script: 20 | - cd org.knime.python3.scripting.nodes/js-src 21 | - npm ci 22 | - npm run type-check 23 | - npm run ci:lint-format 24 | - npm run coverage 25 | - npm run audit 26 | - npm run build 27 | artifacts: 28 | - org.knime.python3.scripting.nodes/js-src/dist/** 29 | 30 | pipelines: 31 | pull-requests: 32 | "**": 33 | - parallel: 34 | - step: *python-format 35 | - step: *js-lint-test-build 36 | branches: 37 | '{master,releases/*}': 38 | - step: *js-lint-test-build 39 | -------------------------------------------------------------------------------- /conftest.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | # Utils 5 | 6 | 7 | def join(*paths): 8 | return os.path.normpath(os.path.join(*paths)) 9 | 10 | 11 | def add_path(*rel_path): 12 | sys.path.insert(0, join(__file__, "..", *rel_path)) 13 | 14 | 15 | def add_src_main_path(plugin_name): 16 | add_path(plugin_name, "src", "main", "python") 17 | 18 | 19 | # Ignore the knime_kernel_test.py because it is run from a JUnit test 20 | 21 | collect_ignore = [ 22 | join( 23 | "org.knime.python3.scripting.tests", 24 | "src", 25 | "test", 26 | "python", 27 | "knime_kernel_test.py", 28 | ), 29 | "pytest-envs", 30 | ] 31 | 32 | # Add paths to the python sources 33 | 34 | add_src_main_path("org.knime.python3") 35 | add_src_main_path("org.knime.python3.nodes") 36 | add_src_main_path("org.knime.python3.scripting") 37 | add_src_main_path("org.knime.python3.scripting.tests") 38 | add_src_main_path("org.knime.python3.views") 39 | add_src_main_path("org.knime.python3.arrow") 40 | add_src_main_path("org.knime.python3.arrow.types") 41 | -------------------------------------------------------------------------------- /doc/KNIME_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/doc/KNIME_Logo.png -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /doc/_static/css/custom.css: -------------------------------------------------------------------------------- 1 | .wy-nav-content{ 2 | max-width: 100% !important; 3 | 4 | } 5 | .rst-content{ 6 | max-width: 1000px !important; 7 | } 8 | 9 | 10 | dl, ol, ul { 11 | width: 100% !important; 12 | } 13 | 14 | dt { 15 | border-top: 3px solid #ffd800 !important; 16 | background: #eff1f2 !important; 17 | } 18 | 19 | li.current{ 20 | aria-expanded: true !important; 21 | } 22 | 23 | html.writer-html4 .rst-content dl:not(.docutils) > dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) > dt{ 24 | color: #6e6e6e !important; 25 | } 26 | 27 | .a.reference{ 28 | color: black !important; 29 | } 30 | 31 | .rst-content .toctree-wrapper ul li > * { 32 | margin-top: 0; 33 | } 34 | -------------------------------------------------------------------------------- /doc/_static/js/redirect.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Redirects for old versions of the documentation 3 | */ 4 | const redirects = { 5 | /* Root */ 6 | "#contents": "/index.html", 7 | 8 | /* Python Script API */ 9 | "#python-script-api": "/script-api.html", 10 | "#inputs-and-outputs": "/script-api.html#inputs-and-outputs", 11 | "#classes": "/script-api.html#classes", 12 | "#views": "/script-api.html#views", 13 | 14 | /* Python Extension Development */ 15 | "#python-extension-development-labs": "/extension-development.html", 16 | "#nodes": "/extension-development.html#nodes", 17 | "#decorators": "/extension-development.html#decorators", 18 | "#parameters": "/extension-development.html#parameters", 19 | "#tables": "/extension-development.html#tables", 20 | "#data-types": "/extension-development.html#data-types", 21 | 22 | /* Deprecated Python Script API */ 23 | "#deprecated-python-script-api": "/deprecated-script-api.html", 24 | "#id3": "/deprecated-script-api.html#inputs-and-outputs", 25 | "#factory-methods": "/deprecated-script-api.html#factory-methods", 26 | "#id4": "/deprecated-script-api.html#classes", 27 | }; 28 | 29 | function doRedirect(versionString) { 30 | const target = redirects[window.location.hash]; 31 | if (target) { 32 | window.location.replace(window.location.origin + versionString + target); 33 | } 34 | } 35 | 36 | const p = window.location.pathname; 37 | if (p === "/en/latest/" || p === "/en/latest/index.html") { 38 | // Redirect if there is a hash 39 | doRedirect("/en/latest") 40 | } else if (p === "/en/stable/" || p === "/en/stable/index.html") { 41 | // Redirect if there is a hash 42 | doRedirect("/en/stable") 43 | } 44 | /* else: 45 | * No redirect necessary because we are on a specific version 46 | * or on a file that did not exist before 47 | */ 48 | -------------------------------------------------------------------------------- /doc/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {%- extends "!layout.html" %} 2 | 3 | {% block sidebartitle %} 4 | 5 | 6 | 7 | 8 | 9 | {% if theme_display_version %} 10 | {%- set nav_version = version %} 11 | {% if READTHEDOCS and current_version %} 12 | {%- set nav_version = current_version %} 13 | {% endif %} 14 | {% if nav_version %} 15 | 16 | {{ nav_version }} 17 | 18 | {% endif %} 19 | {% endif %} 20 | 21 | {% include "searchbox.html" %} 22 | 23 | {% endblock %} -------------------------------------------------------------------------------- /doc/deprecated-script-api.rst: -------------------------------------------------------------------------------- 1 | Deprecated Python Script API 2 | ============================ 3 | 4 | This section lists the API of the module ``knime_io`` that functioned as the main contact point between KNIME 5 | and Python in the `KNIME Python Script node `_ 6 | in KNIME AP before version 4.7, when the Python Script node was moved out of Labs. 7 | Please refer to the `KNIME Python Integration Guide `_ 8 | for more details on how to set up and use the node. 9 | 10 | .. warning:: 11 | This API is deprecated since KNIME AP 4.7, please use the current API as described in :ref:`Python Script API` 12 | 13 | Inputs and outputs 14 | ------------------ 15 | 16 | These properties can be used to retrieve data from or pass data back to KNIME Analytics Platform. 17 | The length of the input and output lists depends on the number of input and output ports of the node. 18 | 19 | **Example:** 20 | If you have a Python Script node configured with two input tables and one input object, you can 21 | access the two tables via ``knime_io.input_tables[0]`` and ``knime_io.input_tables[1]``, and the input object 22 | via ``knime_io.input_objects[0]``. 23 | 24 | .. automodule:: knime_io 25 | :members: input_tables, input_objects, output_tables, output_objects, output_images, flow_variables 26 | :noindex: 27 | 28 | Factory methods 29 | --------------- 30 | 31 | Use these methods to fill the ``knime_io.output_tables``. 32 | 33 | .. automodule:: knime_io 34 | :members: write_table, batch_write_table 35 | :noindex: 36 | 37 | Classes 38 | ------- 39 | 40 | .. autoclass:: knime.scripting._deprecated._table.Batch 41 | :members: 42 | :noindex: 43 | :inherited-members: 44 | :special-members: __getitem__ 45 | 46 | .. autoclass:: knime.scripting._deprecated._table.ReadTable 47 | :members: 48 | :noindex: 49 | :inherited-members: 50 | :special-members: __getitem__, __len__ 51 | 52 | .. autoclass:: knime.scripting._deprecated._table.WriteTable 53 | :members: 54 | :noindex: 55 | :inherited-members: 56 | 57 | .. autoclass:: knime.scripting._deprecated._table.BatchWriteTable 58 | :members: 59 | :noindex: 60 | :inherited-members: 61 | -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | KNIME Python API 2 | ================ 3 | 4 | 5 | This document lists the Python API that can be used to communicate with KNIME within :ref:`Python scripts` 6 | and :ref:`Python extensions`. 7 | 8 | 9 | .. toctree:: 10 | :maxdepth: 3 11 | 12 | script-api 13 | extension-development 14 | deprecated-script-api 15 | license 16 | -------------------------------------------------------------------------------- /doc/license.rst: -------------------------------------------------------------------------------- 1 | License 2 | ======= 3 | .. include:: license_input.txt 4 | :literal: -------------------------------------------------------------------------------- /doc/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.https://www.sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx 2 | sphinx-rtd-theme>=1.2.0rc3 -------------------------------------------------------------------------------- /doc/script-api.rst: -------------------------------------------------------------------------------- 1 | Python Script API 2 | ================= 3 | 4 | This section lists the API of the module ``knime.scripting.io`` that functions as the main contact point between KNIME 5 | and Python in the `KNIME Python Script node `_. 6 | Please refer to the `KNIME Python Integration Guide `_ for more details on how to set up and use the node. 7 | 8 | .. note:: 9 | Before KNIME AP 4.7, the module used to interact with KNIME from Python was called ``knime_io`` and provided a slightly 10 | different API. Since KNIME AP 4.7 the new Python Script node is no longer in `Labs` status and uses the ``knime.scripting.io`` 11 | module for interaction between KNIME and Python. It uses the same Table and Batch classes as can be used in KNIME Python Extensions. 12 | The previous API is described in :ref:`Deprecated Python Script API` 13 | 14 | 15 | Inputs and outputs 16 | ------------------ 17 | 18 | These properties can be used to retrieve data from or pass data back to KNIME Analytics Platform. 19 | The length of the input and output lists depends on the number of input and output ports of the node. 20 | 21 | **Example:** 22 | If you have a Python Script node configured with two input tables and one input object, you can 23 | access the two tables via ``knime.scripting.io.input_tables[0]`` and ``knime.scripting.io.input_tables[1]``, and the input object 24 | via ``knime.scripting.io.input_objects[0]``. 25 | 26 | .. automodule:: knime.scripting.io 27 | :members: input_tables, input_objects, output_tables, output_objects, output_images, output_view, flow_variables 28 | :noindex: 29 | 30 | 31 | Classes 32 | ------- 33 | 34 | .. autoclass:: knime.scripting.io.Table 35 | :members: 36 | :noindex: 37 | :inherited-members: 38 | :special-members: __getitem__, __len__ 39 | 40 | 41 | .. autoclass:: knime.scripting.io.BatchOutputTable 42 | :members: 43 | :noindex: 44 | :inherited-members: 45 | 46 | 47 | Views 48 | ----- 49 | 50 | .. autofunction:: knime.scripting.io.view 51 | :noindex: 52 | 53 | .. autofunction:: knime.scripting.io.view_matplotlib 54 | :noindex: 55 | 56 | .. autofunction:: knime.scripting.io.view_seaborn 57 | :noindex: 58 | 59 | .. autofunction:: knime.scripting.io.view_plotly 60 | :noindex: 61 | 62 | .. autofunction:: knime.scripting.io.view_html 63 | :noindex: 64 | 65 | .. autofunction:: knime.scripting.io.view_svg 66 | :noindex: 67 | 68 | .. autofunction:: knime.scripting.io.view_png 69 | :noindex: 70 | 71 | .. autofunction:: knime.scripting.io.view_jpeg 72 | :noindex: 73 | 74 | .. autofunction:: knime.scripting.io.view_ipy_repr 75 | :noindex: 76 | 77 | .. autoclass:: knime.scripting.io.NodeView 78 | :members: 79 | :noindex: 80 | 81 | Utility functions 82 | ----------------- 83 | 84 | .. autofunction:: knime.scripting.io.get_workflow_temp_dir 85 | :noindex: 86 | 87 | .. autofunction:: knime.scripting.io.get_workflow_data_area_dir 88 | :noindex: -------------------------------------------------------------------------------- /junit-tests/README.md: -------------------------------------------------------------------------------- 1 | # JUnit Tests 2 | 3 | The JUnit tests test the Java code of the Python integration and the 4 | communication between Java and Python. They require a basic Python environment. 5 | Compatibility with different versions of Python packages are tested by the 6 | pytest unit tests and by the workflow integration tests. 7 | -------------------------------------------------------------------------------- /junit-tests/env_py39.yml: -------------------------------------------------------------------------------- 1 | name: python_test_environment 2 | channels: 3 | - conda-forge 4 | - knime 5 | dependencies: 6 | - python=3.9 7 | - knime-python-base=4.7 8 | - matplotlib 9 | -------------------------------------------------------------------------------- /junit-tests/setup-Linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create the Python environment for JUnit tests 4 | envYml="${WORKSPACE}/junit-tests/env_py39.yml" 5 | envPath="${WORKSPACE}/python_test_environment" 6 | echo "Creating Conda environment for: ${envYml} at ${envPath}" 7 | 8 | micromamba create \ 9 | -p ${envPath} \ 10 | -f ${envYml} 11 | micromamba list -p ${envPath} 12 | 13 | export PYTHON3_EXEC_PATH_LINUX="${envPath}/bin/python" 14 | -------------------------------------------------------------------------------- /knime-extension/.gitignore: -------------------------------------------------------------------------------- 1 | ./knime-extension/** 2 | -------------------------------------------------------------------------------- /knime-extension/README.md: -------------------------------------------------------------------------------- 1 | ## Sharing for autocompletion 2 | 3 | This manual shall help in sharing and testing the most user-facing functionalities of Python extension development to get information about them and have some autocompletion. 4 | 5 | ### Share 6 | 7 | 1. Run the `collect_files.py` script with this folder as the working directory 8 | 2. `conda build recipe -c conda-forge --output-folder output` 9 | 3. Login to some anaconda account which is associated with our channel `knime` 10 | 4. `anaconda upload --user KNIME --label nightly {path/to/knime-extension.tar.bz2}` 11 | 12 | 13 | ### Test 14 | 1. Create some test environment, e.g. 15 | `conda create -n my_autocompletion_test_env knime-python-base knime-extension packaging -c knime -c conda-forge` 16 | 2. Select that environment in your editor (VS Code,...) 17 | 3. Open some Pytho extension file 18 | 4. See whether the information of the classes and methods and attributes are shown and whether you can autocomplete `knext` thingies -------------------------------------------------------------------------------- /knime-extension/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "knime-extension" 3 | version = "5.5" 4 | 5 | [build-system] 6 | requires = ["setuptools"] 7 | 8 | [tool.setuptools.packages.find] 9 | where = ["knime-extension"] 10 | -------------------------------------------------------------------------------- /knime-extension/recipe/meta.yaml: -------------------------------------------------------------------------------- 1 | {% set version = "5.5.0" %} 2 | 3 | package: 4 | name: knime-extension 5 | version: {{ version }} 6 | 7 | # https://github.com/conda/conda-build/pull/5112 8 | source: 9 | path: .. 10 | 11 | requirements: 12 | build: 13 | - python=3.9 14 | - pip 15 | - setuptools 16 | - build 17 | - wheel 18 | run: 19 | - python>=3.9 20 | 21 | build: 22 | noarch: python 23 | string: py{{ python | replace(".", "") }}_{{time.strftime("%Y%m%d%H%M").strip()}} 24 | script: python -m pip install . --no-build-isolation 25 | 26 | test: 27 | imports: 28 | - knime 29 | - knime.api 30 | - knime.api.schema 31 | - knime.api.table 32 | - knime.api.types 33 | - knime.api.views 34 | - knime.extension 35 | - knime.extension.nodes 36 | - knime.extension.parameter 37 | - knime.extension.version 38 | - knime.extension.testing 39 | - knime_extension 40 | requires: 41 | - pandas 42 | - python-dateutil 43 | - pytz 44 | - requests 45 | - pytest 46 | commands: 47 | - pytest . 48 | source_files: 49 | - recipe/node_with_test.py 50 | - recipe/test/plugin.xml 51 | - recipe/test/knime/types/chemistry.py 52 | 53 | about: 54 | home: https://knime.com 55 | author: KNIME GmbH, Germany 56 | license: GPLv3 57 | license_file: ../LICENSE.TXT 58 | summary: API for KNIME Python extension development to facilitate autocompletion 59 | description: API for KNIME Python extension development to facilitate autocompletion 60 | 61 | extra: 62 | maintainers: 63 | - Team Rakete (team-rakete@knime.com) 64 | -------------------------------------------------------------------------------- /org.knime.ext.py4j/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /org.knime.ext.py4j/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.ext.py4j 4 | 5 | 6 | 7 | 8 | 9 | org.python.pydev.PyDevBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.m2e.core.maven2Builder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.ManifestBuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.pde.SchemaBuilder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.m2e.core.maven2Nature 36 | org.eclipse.jdt.core.javanature 37 | org.python.pydev.pythonNature 38 | org.eclipse.pde.PluginNature 39 | 40 | 41 | 42 | 0 43 | 44 | 30 45 | 46 | org.eclipse.core.resources.regexFilterMatcher 47 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /org.knime.ext.py4j/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//py/DBUtil.py=utf-8 3 | encoding//py/DataTables.py=utf-8 4 | encoding//py/EnvironmentHelper.py=utf-8 5 | encoding//py/JupyterSupport.py=utf-8 6 | encoding//py/PythonCommands.py=utf-8 7 | encoding//py/PythonKernelBase.py=utf-8 8 | encoding//py/PythonKernelLauncher.py=utf-8 9 | encoding//py/PythonKernelTester.py=utf-8 10 | encoding//py/PythonUtils.py=utf-8 11 | encoding//py/ReadWriteLock.py=utf-8 12 | encoding//py/Serializer.py=utf-8 13 | encoding//py/TypeExtensionManager.py=utf-8 14 | encoding//py/debug_util.py=utf-8 15 | encoding//py/jaydebeapi.py=utf-8 16 | encoding//py/messaging/AbstractTaskHandler.py=utf-8 17 | encoding//py/messaging/Message.py=utf-8 18 | encoding//py/messaging/MessageDistributor.py=utf-8 19 | encoding//py/messaging/MessageReceiver.py=utf-8 20 | encoding//py/messaging/MessageSender.py=utf-8 21 | encoding//py/messaging/PythonMessagingBase.py=utf-8 22 | encoding//py/messaging/RequestHandlers.py=utf-8 23 | encoding//py/messaging/Task.py=utf-8 24 | encoding//py/python2/PythonKernel.py=utf-8 25 | encoding//py/python2/SynchronousExecutor.py=utf-8 26 | encoding//py/python2/messaging/PythonMessaging.py=utf-8 27 | encoding//py/python3/PythonKernel.py=utf-8 28 | encoding//py/python3/_ExecutionMonitor.py=utf-8 29 | encoding//py/python3/_QueuedExecutor.py=utf-8 30 | encoding//py/python3/messaging/AbstractMessageLoop.py=utf-8 31 | encoding//py/python3/messaging/MessageDistributorLoop.py=utf-8 32 | encoding//py/python3/messaging/MessageReceiverLoop.py=utf-8 33 | encoding//py/python3/messaging/PythonMessaging.py=utf-8 34 | encoding//py/python3/messaging/testing/MessagingTest.py=utf-8 35 | encoding/=UTF-8 36 | -------------------------------------------------------------------------------- /org.knime.ext.py4j/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.ext.py4j 8 | -------------------------------------------------------------------------------- /org.knime.ext.py4j/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: OSGi Wrapper for py4j 4 | Bundle-SymbolicName: org.knime.ext.py4j;singleton:=true 5 | Bundle-Version: 0.10.9.2 6 | Bundle-ClassPath: ., 7 | lib/py4j-0.10.9.2.jar 8 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 9 | Bundle-RequiredExecutionEnvironment: JavaSE-17 10 | Bundle-ActivationPolicy: lazy 11 | Export-Package: py4j 12 | Automatic-Module-Name: org.knime.ext.py4j 13 | Bundle-Activator: org.knime.ext.py4j.Activator 14 | Require-Bundle: org.eclipse.osgi;bundle-version="[3.16.200,4.0.0)" 15 | Eclipse-BuddyPolicy: registered 16 | -------------------------------------------------------------------------------- /org.knime.ext.py4j/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | CHANGELOG.md,\ 4 | LICENSE.TXT,\ 5 | lib/ 6 | src.includes = LICENSE.TXT 7 | source.. = src/main/java/ 8 | bin.excludes = maven.properties 9 | -------------------------------------------------------------------------------- /org.knime.ext.py4j/lib/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2018, Barthelemy Dagenais and individual contributors. All 2 | rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | - Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | - The name of the author may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /org.knime.ext.py4j/lib/README.txt: -------------------------------------------------------------------------------- 1 | This folder contains the Java library py4j created by Barthelemy Dagenais, which 2 | has been obtained from https://mvnrepository.com/artifact/net.sf.py4j/py4j/0.10.9.2. -------------------------------------------------------------------------------- /org.knime.ext.py4j/lib/py4j-0.10.9.2.jar: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b101d1938c43003d4e0935c383e664135ab87186c44180a2a9296ca3bbe29e89 3 | size 123055 4 | -------------------------------------------------------------------------------- /org.knime.features.python3.nodes/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.features.python3.nodes 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.FeatureBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.pde.FeatureNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.knime.features.python3.nodes/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.features.python3.nodes/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = feature.xml,\ 2 | CHANGELOG.md 3 | bin.excludes = maven.properties 4 | -------------------------------------------------------------------------------- /org.knime.features.python3.scripting/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.features.python3.scripting 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.FeatureBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.pde.FeatureNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.knime.features.python3.scripting/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.features.python3.scripting/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = feature.xml,\ 2 | CHANGELOG.md 3 | bin.excludes = maven.properties 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.arrow.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.arrow.tests 8 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Unit Tests for org.knime.python3.arrow 4 | Bundle-SymbolicName: org.knime.python3.arrow.tests;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Fragment-Host: org.knime.python3.arrow;bundle-version="[5.5.0,6.0.0)" 10 | Require-Bundle: org.junit;bundle-version="[4.13.0,5.0.0)", 11 | io.netty.all;bundle-version="[4.1.68,4.2.0)", 12 | org.apache.commons.lang3;bundle-version="[3.9.0,4.0.0)", 13 | org.knime.core.columnar;bundle-version="[5.5.0,6.0.0)", 14 | org.knime.core.data.columnar;bundle-version="[5.5.0,6.0.0)", 15 | org.knime.python3.testing;bundle-version="[5.5.0,6.0.0)" 16 | Automatic-Module-Name: org.knime.python3.arrow.tests 17 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | LICENSE.TXT,\ 4 | src/test/python/ 5 | src.includes = LICENSE.TXT 6 | src.excludes = src/test/python/ 7 | source.. = src/test/java/ 8 | output.. = target/classes/ 9 | bin.excludes = maven.properties 10 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.knime 5 | knime-python 6 | ${revision}${changelist} 7 | 8 | org.knime.python3.arrow.tests 9 | eclipse-test-plugin 10 | 11 | 12 | 5.5.0 13 | 14 | src 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.tycho 21 | target-platform-configuration 22 | ${tycho.version} 23 | 24 | 25 | 26 | 27 | eclipse-feature 28 | org.knime.features.clfixes 29 | 0.0.0 30 | 31 | 32 | 33 | eclipse-feature 34 | org.knime.features.core.columnar 35 | 0.0.0 36 | 37 | 38 | 39 | 40 | 41 | 42 | org.eclipse.tycho 43 | tycho-surefire-plugin 44 | ${tycho.version} 45 | 46 | ${failsafeArgLine} ${knime.tycho.test.configuration} 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/5kDictEncodedChunkedGeospatials.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6473796b2aaf32c71de3b7b7d8d9546601228cfc3ed8a094abce1342e486e716 3 | size 301410 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/DictEncString.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:41f30781cbcdc0ecf2139319a2b7329bb20723c335615c71ad727e0cd23c34e7 3 | size 5522 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/GeoWithDateTime.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:45564401d6a39c7adf2d2e25f5786d73a8a1e74e5b397fb242102c5a44681818 3 | size 7378 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/Lists.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8d491c9749986de7c0f0852eb13469eb4c774eafe9a1756b4ed914bea001a9af 3 | size 4466 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/dates.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:39b8b3804273c05407565fc1f3e9613edc3913b84de79fac492d56e0ae77f948 3 | size 1922 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/dict_enc_fs_location.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:69138529eecc1dbf680a3e1dc10670f1fec0dac88b66bd195e7dc9c6b36b5c83 3 | size 4906 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/generatedTestData.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:337d6c893b74348b674d316f5ea30cd134b180688a2fc1c4b50e234c848a1786 3 | size 10673794 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/geospatial_table_3.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:df3e7ed051b99cd954d4be5aa1fcc7648c4f72cc7ed44e1e86cab4fa9068ee8e 3 | size 2754 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/missingTestData.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fc035339c5addfde1583ec710aecded32991adc4b6055aba9a6c38452d6d4a01 3 | size 51770 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.tests/src/test/python/unittest/rdkit.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e7124a41648f2552e8e4a8f644f4b7e0933c1e4b4817184c68b1dba45ed2ab4e 3 | size 15314 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.arrow.types.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types.tests/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.arrow.types.tests 8 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Unit Tests for org.knime.python3.arrow.types 4 | Bundle-SymbolicName: org.knime.python3.arrow.types.tests;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Fragment-Host: org.knime.python3.arrow.types;bundle-version="[5.5.0,6.0.0)" 10 | Require-Bundle: org.knime.core.table;bundle-version="[5.5.0,6.0.0)", 11 | org.knime.core.columnar;bundle-version="[5.5.0,6.0.0)", 12 | org.knime.core.columnar.arrow;bundle-version="[5.5.0,6.0.0)", 13 | org.apache.arrow.memory-core;bundle-version="[18.1.0,19.0.0)", 14 | org.apache.arrow.vector;bundle-version="[18.1.0,19.0.0)", 15 | org.junit;bundle-version="[4.13.0,5.0.0)", 16 | org.knime.core.data.columnar;bundle-version="[5.5.0,6.0.0)", 17 | com.fasterxml.jackson.core.jackson-databind;bundle-version="[2.12.1,3.0.0)", 18 | org.knime.python3.types;bundle-version="[5.5.0,6.0.0)", 19 | org.knime.python3.testing;bundle-version="[5.5.0,6.0.0)" 20 | Automatic-Module-Name: org.knime.python3.arrow.types.tests 21 | Export-Package: org.knime.python3.arrow.types 22 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types.tests/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | LICENSE.TXT,\ 4 | src/test/python/ 5 | src.includes = LICENSE.TXT 6 | src.excludes = src/test/python/ 7 | source.. = src/test/java/ 8 | output.. = target/classes/ 9 | bin.excludes = maven.properties 10 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types.tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.knime 5 | knime-python 6 | ${revision}${changelist} 7 | 8 | org.knime.python3.arrow.types.tests 9 | eclipse-test-plugin 10 | 11 | 12 | 5.5.0 13 | 14 | src 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.tycho 21 | target-platform-configuration 22 | ${tycho.version} 23 | 24 | 25 | 26 | 27 | eclipse-feature 28 | org.knime.features.clfixes 29 | 0.0.0 30 | 31 | 32 | 33 | eclipse-feature 34 | org.knime.features.core.columnar 35 | 0.0.0 36 | 37 | 38 | eclipse-feature 39 | org.knime.features.python3.nodes 40 | 0.0.0 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.eclipse.tycho 48 | tycho-surefire-plugin 49 | ${tycho.version} 50 | 51 | ${failsafeArgLine} ${knime.tycho.test.configuration} 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.arrow.types 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.ManifestBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.SchemaBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.jdt.core.javanature 32 | org.eclipse.pde.PluginNature 33 | 34 | 35 | 36 | 1618234189428 37 | 38 | 30 39 | 40 | org.eclipse.core.resources.regexFilterMatcher 41 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//py/DBUtil.py=utf-8 3 | encoding//py/DataTables.py=utf-8 4 | encoding//py/EnvironmentHelper.py=utf-8 5 | encoding//py/JupyterSupport.py=utf-8 6 | encoding//py/PythonCommands.py=utf-8 7 | encoding//py/PythonKernelBase.py=utf-8 8 | encoding//py/PythonKernelLauncher.py=utf-8 9 | encoding//py/PythonKernelTester.py=utf-8 10 | encoding//py/PythonUtils.py=utf-8 11 | encoding//py/ReadWriteLock.py=utf-8 12 | encoding//py/Serializer.py=utf-8 13 | encoding//py/TypeExtensionManager.py=utf-8 14 | encoding//py/debug_util.py=utf-8 15 | encoding//py/jaydebeapi.py=utf-8 16 | encoding//py/messaging/AbstractTaskHandler.py=utf-8 17 | encoding//py/messaging/Message.py=utf-8 18 | encoding//py/messaging/MessageDistributor.py=utf-8 19 | encoding//py/messaging/MessageReceiver.py=utf-8 20 | encoding//py/messaging/MessageSender.py=utf-8 21 | encoding//py/messaging/PythonMessagingBase.py=utf-8 22 | encoding//py/messaging/RequestHandlers.py=utf-8 23 | encoding//py/messaging/Task.py=utf-8 24 | encoding//py/python2/PythonKernel.py=utf-8 25 | encoding//py/python2/SynchronousExecutor.py=utf-8 26 | encoding//py/python2/messaging/PythonMessaging.py=utf-8 27 | encoding//py/python3/PythonKernel.py=utf-8 28 | encoding//py/python3/_ExecutionMonitor.py=utf-8 29 | encoding//py/python3/_QueuedExecutor.py=utf-8 30 | encoding//py/python3/messaging/AbstractMessageLoop.py=utf-8 31 | encoding//py/python3/messaging/MessageDistributorLoop.py=utf-8 32 | encoding//py/python3/messaging/MessageReceiverLoop.py=utf-8 33 | encoding//py/python3/messaging/PythonMessaging.py=utf-8 34 | encoding//py/python3/messaging/testing/MessagingTest.py=utf-8 35 | encoding/=UTF-8 36 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.arrow.types 8 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: KNIME Python - Extension types for Apache Arrow 4 | Bundle-SymbolicName: org.knime.python3.arrow.types;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: knime-python3-arrow-types.jar 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Bundle-ActivationPolicy: lazy 10 | Require-Bundle: org.knime.filehandling.core;bundle-version="[5.5.0,6.0.0)", 11 | org.knime.python3.arrow;bundle-version="[5.5.0,6.0.0)", 12 | org.knime.python3;bundle-version="[5.5.0,6.0.0)", 13 | org.knime.core;bundle-version="[5.5.0,6.0.0)", 14 | org.knime.core.table;bundle-version="[5.5.0,6.0.0)", 15 | org.knime.ext.py4j;bundle-version="[0.10.9.2,1.0.0)", 16 | org.knime.time;bundle-version="[5.5.0,6.0.0)" 17 | Export-Package: org.knime.python3.arrow.types 18 | Automatic-Module-Name: org.knime.python3.arrow.types 19 | Eclipse-BundleShape: dir 20 | Eclipse-RegisterBuddy: org.knime.ext.py4j 21 | -------------------------------------------------------------------------------- /org.knime.python3.arrow.types/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | knime-python3-arrow-types.jar,\ 3 | LICENSE.TXT,\ 4 | plugin.xml,\ 5 | CHANGELOG.md,\ 6 | src/main/python/ 7 | src.includes = LICENSE.TXT 8 | src.excludes = src/main/python/ 9 | source.knime-python3-arrow-types.jar = src/main/java/ 10 | output.knime-python3-arrow-types.jar = target/classes/ 11 | bin.excludes = maven.properties 12 | pom.model.property.sonar.sources=src/ -------------------------------------------------------------------------------- /org.knime.python3.arrow.types/src/main/python/knime/types/tool.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import List, Optional 3 | import knime.api.types as kt 4 | 5 | 6 | @dataclass 7 | class ToolPort: 8 | name: str 9 | description: str 10 | type: str 11 | spec: Optional[str] 12 | 13 | def _to_arrow_dict(self): 14 | return { 15 | "0": self.name, 16 | "1": self.description, 17 | "2": self.type, 18 | "3": self.spec, 19 | } 20 | 21 | @classmethod 22 | def _from_arrow_dict(cls, storage): 23 | if storage is None: 24 | return None 25 | return cls( 26 | name=storage["0"], 27 | description=storage["1"], 28 | type=storage["2"], 29 | spec=storage["3"], 30 | ) 31 | 32 | 33 | @dataclass 34 | class WorkflowTool: 35 | """ 36 | A class representing a tool value in KNIME. 37 | """ 38 | 39 | name: str 40 | description: str 41 | parameter_schema: dict 42 | tool_bytes: bytes 43 | message_output_port_index: int 44 | input_ports: Optional[List[ToolPort]] = None 45 | output_ports: Optional[List[ToolPort]] = None 46 | 47 | 48 | class WorkflowToolValueFactory(kt.PythonValueFactory): 49 | """ 50 | Python equivalent of the WorkflowToolValueFactory class in KNIME, that can read 51 | the Arrow representation of a KNIME workflow tool value and convert it to a Python object. 52 | """ 53 | 54 | def __init__(self): 55 | kt.PythonValueFactory.__init__(self, WorkflowTool) 56 | 57 | def decode(self, storage): 58 | if storage is None: 59 | return None 60 | import json 61 | 62 | param_schema_json = storage["2"] 63 | param_schema = json.loads(param_schema_json) if param_schema_json else {} 64 | 65 | return WorkflowTool( 66 | name=storage["0"], 67 | description=storage["1"], 68 | parameter_schema=param_schema, 69 | tool_bytes=storage["3"], 70 | message_output_port_index=storage["6"], 71 | input_ports=[ToolPort._from_arrow_dict(port) for port in storage["4"]], 72 | output_ports=[ToolPort._from_arrow_dict(port) for port in storage["5"]], 73 | ) 74 | 75 | def encode(self, value: WorkflowTool): 76 | import json 77 | 78 | if value is None: 79 | return None 80 | return { 81 | "0": value.name, 82 | "1": value.description, 83 | "2": json.dumps(value.parameter_schema), 84 | "3": value.tool_bytes, 85 | "4": [port._to_arrow_dict() for port in value.input_ports], 86 | "5": [port._to_arrow_dict() for port in value.output_ports], 87 | "6": value.message_output_port_index, 88 | } 89 | -------------------------------------------------------------------------------- /org.knime.python3.arrow/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.knime.python3.arrow/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.arrow 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.ManifestBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.SchemaBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.jdt.core.javanature 32 | org.eclipse.pde.PluginNature 33 | 34 | 35 | 36 | 1618234189428 37 | 38 | 30 39 | 40 | org.eclipse.core.resources.regexFilterMatcher 41 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /org.knime.python3.arrow/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//py/DBUtil.py=utf-8 3 | encoding//py/DataTables.py=utf-8 4 | encoding//py/EnvironmentHelper.py=utf-8 5 | encoding//py/JupyterSupport.py=utf-8 6 | encoding//py/PythonCommands.py=utf-8 7 | encoding//py/PythonKernelBase.py=utf-8 8 | encoding//py/PythonKernelLauncher.py=utf-8 9 | encoding//py/PythonKernelTester.py=utf-8 10 | encoding//py/PythonUtils.py=utf-8 11 | encoding//py/ReadWriteLock.py=utf-8 12 | encoding//py/Serializer.py=utf-8 13 | encoding//py/TypeExtensionManager.py=utf-8 14 | encoding//py/debug_util.py=utf-8 15 | encoding//py/jaydebeapi.py=utf-8 16 | encoding//py/messaging/AbstractTaskHandler.py=utf-8 17 | encoding//py/messaging/Message.py=utf-8 18 | encoding//py/messaging/MessageDistributor.py=utf-8 19 | encoding//py/messaging/MessageReceiver.py=utf-8 20 | encoding//py/messaging/MessageSender.py=utf-8 21 | encoding//py/messaging/PythonMessagingBase.py=utf-8 22 | encoding//py/messaging/RequestHandlers.py=utf-8 23 | encoding//py/messaging/Task.py=utf-8 24 | encoding//py/python2/PythonKernel.py=utf-8 25 | encoding//py/python2/SynchronousExecutor.py=utf-8 26 | encoding//py/python2/messaging/PythonMessaging.py=utf-8 27 | encoding//py/python3/PythonKernel.py=utf-8 28 | encoding//py/python3/_ExecutionMonitor.py=utf-8 29 | encoding//py/python3/_QueuedExecutor.py=utf-8 30 | encoding//py/python3/messaging/AbstractMessageLoop.py=utf-8 31 | encoding//py/python3/messaging/MessageDistributorLoop.py=utf-8 32 | encoding//py/python3/messaging/MessageReceiverLoop.py=utf-8 33 | encoding//py/python3/messaging/PythonMessaging.py=utf-8 34 | encoding//py/python3/messaging/testing/MessagingTest.py=utf-8 35 | encoding/=UTF-8 36 | -------------------------------------------------------------------------------- /org.knime.python3.arrow/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.arrow 8 | -------------------------------------------------------------------------------- /org.knime.python3.arrow/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: KNIME Python - Data Transfer using Apache Arrow 4 | Bundle-SymbolicName: org.knime.python3.arrow;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: knime-python3-arrow.jar 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Bundle-ActivationPolicy: lazy 10 | Require-Bundle: org.knime.python3;bundle-version="[5.5.0,6.0.0)", 11 | org.knime.core.table;bundle-version="[5.5.0,6.0.0)", 12 | org.knime.core.columnar;bundle-version="[5.5.0,6.0.0)", 13 | org.knime.core.columnar.arrow;bundle-version="[5.5.0,6.0.0)", 14 | slf4j.api;bundle-version="[2.0.12,3.0.0)", 15 | org.apache.commons.commons-io;bundle-version="[2.15.1,3.0.0)", 16 | org.apache.arrow.memory-core;bundle-version="[18.1.0,19.0.0)", 17 | org.apache.arrow.format;bundle-version="[18.1.0,19.0.0)", 18 | org.apache.arrow.vector;bundle-version="[18.1.0,19.0.0)", 19 | org.eclipse.core.runtime;bundle-version="[3.20.100,4.0.0)", 20 | org.knime.core;bundle-version="[5.5.0,6.0.0)", 21 | org.knime.core.data.columnar;bundle-version="[5.5.0,6.0.0)", 22 | org.knime.ext.py4j;bundle-version="[0.10.9.2,1.0.0)", 23 | com.google.guava;bundle-version="[19.0.0,20.0.0)" 24 | Export-Package: org.knime.python3.arrow 25 | Automatic-Module-Name: org.knime.python3.arrow 26 | Eclipse-BundleShape: dir 27 | Eclipse-RegisterBuddy: org.knime.ext.py4j 28 | -------------------------------------------------------------------------------- /org.knime.python3.arrow/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = knime-python3-arrow.jar,\ 2 | META-INF/,\ 3 | LICENSE.TXT,\ 4 | CHANGELOG.md,\ 5 | src/main/python/ 6 | src.includes = LICENSE.TXT 7 | src.excludes = src/main/python/ 8 | source.knime-python3-arrow.jar = src/main/java/ 9 | output.knime-python3-arrow.jar = target/classes/ 10 | bin.excludes = maven.properties 11 | pom.model.property.sonar.sources=src/ -------------------------------------------------------------------------------- /org.knime.python3.arrow/src/main/python/knime/_arrow/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module is not intended to be used or referenced by clients. 3 | """ 4 | -------------------------------------------------------------------------------- /org.knime.python3.arrow/src/main/python/knime/_arrow/_utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------ 3 | # Copyright by KNIME AG, Zurich, Switzerland 4 | # Website: http://www.knime.com; Email: contact@knime.com 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License, Version 3, as 8 | # published by the Free Software Foundation. 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, see . 17 | # 18 | # Additional permission under GNU GPL version 3 section 7: 19 | # 20 | # KNIME interoperates with ECLIPSE solely via ECLIPSE's plug-in APIs. 21 | # Hence, KNIME and ECLIPSE are both independent programs and are not 22 | # derived from each other. Should, however, the interpretation of the 23 | # GNU GPL Version 3 ("License") under any applicable laws result in 24 | # KNIME and ECLIPSE being a combined program, KNIME AG herewith grants 25 | # you the additional permission to use and propagate KNIME together with 26 | # ECLIPSE with only the license terms in place for ECLIPSE applying to 27 | # ECLIPSE and the GNU GPL Version 3 applying for KNIME, provided the 28 | # license terms of ECLIPSE themselves allow for the respective use and 29 | # propagation of ECLIPSE together with KNIME. 30 | # 31 | # Additional permission relating to nodes for KNIME that extend the Node 32 | # Extension (and in particular that are based on subclasses of NodeModel, 33 | # NodeDialog, and NodeView) and that only interoperate with KNIME through 34 | # standard APIs ("Nodes"): 35 | # Nodes are deemed to be separate and independent programs and to not be 36 | # covered works. Notwithstanding anything to the contrary in the 37 | # License, the License does not apply to Nodes, you are not required to 38 | # license Nodes under the License, and you are granted a license to 39 | # prepare and propagate Nodes, in each case even if such Nodes are 40 | # propagated with or for interoperation with KNIME. The owner of a Node 41 | # may freely choose the license terms applicable to such Node, including 42 | # when such Node is propagated with or for interoperation with KNIME. 43 | # ------------------------------------------------------------------------ 44 | 45 | """ 46 | @author Benjamin Wilhelm, KNIME GmbH, Konstanz, Germany 47 | @author Adrian Nembach, KNIME GmbH, Konstanz, Germany 48 | """ 49 | 50 | 51 | def normalize_index(index, length): 52 | if index < 0: 53 | index = index + length 54 | if index < 0 or index >= length: 55 | raise IndexError("index out of range") 56 | return index 57 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.py4j.dependencies/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.py4j.dependencies/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.nodes.py4j.dependencies 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.py4j.dependencies/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.py4j.dependencies/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey= 8 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.py4j.dependencies/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: KNIME Python 3 Nodes - Additional Dependencies of OSGi Wrapper for py4j 4 | Bundle-SymbolicName: org.knime.python3.nodes.py4j.dependencies;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Fragment-Host: org.knime.ext.py4j;bundle-version="[0.10.9.2,0.11.0)" 10 | Automatic-Module-Name: org.knime.python3.nodes.py4j.dependencies 11 | Require-Bundle: org.knime.core.table;bundle-version="[5.5.0,6.0.0)" 12 | 13 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.py4j.dependencies/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | CHANGELOG.md,\ 4 | LICENSE.TXT 5 | src.includes = LICENSE.TXT 6 | bin.excludes = maven.properties 7 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.nodes.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.nodes.tests 8 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Unit Tests for org.knime.python3.nodes 4 | Bundle-SymbolicName: org.knime.python3.nodes.tests;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Fragment-Host: org.knime.python3.nodes;bundle-version="[5.5.0,6.0.0)" 10 | Require-Bundle: org.junit;bundle-version="[4.13.0,5.0.0)", 11 | io.netty.all;bundle-version="[4.1.68,4.2.0)", 12 | org.apache.commons.lang3;bundle-version="[3.9.0,4.0.0)", 13 | org.knime.core.columnar;bundle-version="[5.5.0,6.0.0)", 14 | org.knime.core.data.columnar;bundle-version="[5.5.0,6.0.0)", 15 | org.mockito.mockito-core;bundle-version="[2.28.2,3.0.0)", 16 | org.knime.python3.testing;bundle-version="[5.5.0,6.0.0)" 17 | Automatic-Module-Name: org.knime.python3.nodes.tests 18 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | LICENSE.TXT,\ 4 | src/test/python/,\ 5 | fragment.xml 6 | src.includes = LICENSE.TXT 7 | src.excludes = src/test/python/ 8 | source.. = src/test/java/ 9 | output.. = target/classes/ 10 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.knime 5 | knime-python 6 | ${revision}${changelist} 7 | 8 | org.knime.python3.nodes.tests 9 | eclipse-test-plugin 10 | 11 | 12 | 5.5.0 13 | 14 | src 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.tycho 21 | target-platform-configuration 22 | ${tycho.version} 23 | 24 | 25 | 26 | 27 | eclipse-feature 28 | org.knime.features.clfixes 29 | 0.0.0 30 | 31 | 32 | eclipse-feature 33 | org.knime.features.core.columnar 34 | 0.0.0 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/src/test/python/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/org.knime.python3.nodes.tests/src/test/python/__init__.py -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/src/test/python/unittest/generatedTestData.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:337d6c893b74348b674d316f5ea30cd134b180688a2fc1c4b50e234c848a1786 3 | size 10673794 4 | -------------------------------------------------------------------------------- /org.knime.python3.nodes.tests/src/test/resources/test_png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/org.knime.python3.nodes.tests/src/test/resources/test_png.png -------------------------------------------------------------------------------- /org.knime.python3.nodes/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.knime.python3.nodes/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.nodes 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.ManifestBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.SchemaBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.jdt.core.javanature 32 | org.eclipse.pde.PluginNature 33 | 34 | 35 | 36 | 0 37 | 38 | 30 39 | 40 | org.eclipse.core.resources.regexFilterMatcher 41 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /org.knime.python3.nodes/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//py/DBUtil.py=utf-8 3 | encoding//py/DataTables.py=utf-8 4 | encoding//py/EnvironmentHelper.py=utf-8 5 | encoding//py/JupyterSupport.py=utf-8 6 | encoding//py/PythonCommands.py=utf-8 7 | encoding//py/PythonKernelBase.py=utf-8 8 | encoding//py/PythonKernelLauncher.py=utf-8 9 | encoding//py/PythonKernelTester.py=utf-8 10 | encoding//py/PythonUtils.py=utf-8 11 | encoding//py/ReadWriteLock.py=utf-8 12 | encoding//py/Serializer.py=utf-8 13 | encoding//py/TypeExtensionManager.py=utf-8 14 | encoding//py/debug_util.py=utf-8 15 | encoding//py/jaydebeapi.py=utf-8 16 | encoding//py/messaging/AbstractTaskHandler.py=utf-8 17 | encoding//py/messaging/Message.py=utf-8 18 | encoding//py/messaging/MessageDistributor.py=utf-8 19 | encoding//py/messaging/MessageReceiver.py=utf-8 20 | encoding//py/messaging/MessageSender.py=utf-8 21 | encoding//py/messaging/PythonMessagingBase.py=utf-8 22 | encoding//py/messaging/RequestHandlers.py=utf-8 23 | encoding//py/messaging/Task.py=utf-8 24 | encoding//py/python2/PythonKernel.py=utf-8 25 | encoding//py/python2/SynchronousExecutor.py=utf-8 26 | encoding//py/python2/messaging/PythonMessaging.py=utf-8 27 | encoding//py/python3/PythonKernel.py=utf-8 28 | encoding//py/python3/_ExecutionMonitor.py=utf-8 29 | encoding//py/python3/_QueuedExecutor.py=utf-8 30 | encoding//py/python3/messaging/AbstractMessageLoop.py=utf-8 31 | encoding//py/python3/messaging/MessageDistributorLoop.py=utf-8 32 | encoding//py/python3/messaging/MessageReceiverLoop.py=utf-8 33 | encoding//py/python3/messaging/PythonMessaging.py=utf-8 34 | encoding//py/python3/messaging/testing/MessagingTest.py=utf-8 35 | encoding//src/main/python/_kernel_launcher.py=utf-8 36 | encoding//src/main/python/org/knime/python3/py_modules/knime/client.py=utf-8 37 | encoding/=UTF-8 38 | -------------------------------------------------------------------------------- /org.knime.python3.nodes/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.nodes 8 | -------------------------------------------------------------------------------- /org.knime.python3.nodes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: KNIME Python 3 - Nodes 4 | Bundle-SymbolicName: org.knime.python3.nodes;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: knime-python3-nodes.jar 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Bundle-ActivationPolicy: lazy 10 | Require-Bundle: 11 | org.knime.core;bundle-version="[5.5.0,6.0.0)", 12 | org.knime.core.ui;bundle-version="[5.5.0,6.0.0)", 13 | com.fasterxml.jackson.core.jackson-databind;bundle-version="[2.12.1,3.0.0)", 14 | com.fasterxml.jackson.core.jackson-core;bundle-version="[2.12.1,3.0.0)", 15 | org.knime.python3;bundle-version="[5.5.0,6.0.0)", 16 | org.knime.python3.arrow;bundle-version="[5.5.0,6.0.0)", 17 | org.knime.workbench.repository;bundle-version="[5.5.0,6.0.0)", 18 | org.knime.ext.py4j;bundle-version="[0.10.9.2,1.0.0)", 19 | org.knime.core.columnar;bundle-version="[5.5.0,6.0.0)", 20 | org.knime.core.data.columnar;bundle-version="[5.5.0,6.0.0)", 21 | org.knime.core.table;bundle-version="[5.5.0,6.0.0)", 22 | org.knime.core.columnar.arrow;bundle-version="[5.5.0,6.0.0)", 23 | com.google.guava;bundle-version="[19.0.0,20.0.0)", 24 | org.yaml.snakeyaml;bundle-version="[2.4.0,3.0.0)", 25 | org.knime.conda.envbundling;bundle-version="[5.5.0,6.0.0)", 26 | org.knime.conda;bundle-version="[5.5.0,6.0.0)", 27 | com.google.gson;bundle-version="[2.8.6,3.0.0)", 28 | org.knime.python3.views;bundle-version="[5.5.0,6.0.0)", 29 | org.knime.python3.types;bundle-version="[5.5.0,6.0.0)", 30 | org.eclipse.jface;bundle-version="[3.26.0,4.0.0)", 31 | org.eclipse.ui.ide;bundle-version="[3.19.0,4.0.0)", 32 | org.eclipse.ui;bundle-version="[3.201.0,4.0.0)", 33 | org.apache.batik.anim;bundle-version="[1.14.0,2.0.0)", 34 | org.knime.ext.svg;bundle-version="[5.5.0,6.0.0)", 35 | org.knime.credentials.base;bundle-version="[5.5.0,6.0.0)", 36 | org.knime.credentials.base.oauth;bundle-version="[5.5.0,6.0.0)", 37 | com.fasterxml.jackson.core.jackson-annotations;bundle-version="[2.13.2,3.0.0)", 38 | org.knime.workflowservices;bundle-version="[5.5.0,6.0.0)", 39 | org.apache.commons.lang3;bundle-version="[3.9.0,4.0.0)" 40 | Automatic-Module-Name: org.knime.python3.nodes 41 | Eclipse-RegisterBuddy: org.knime.ext.py4j 42 | Eclipse-BundleShape: dir 43 | Bundle-Activator: org.knime.python3.nodes.Activator 44 | -------------------------------------------------------------------------------- /org.knime.python3.nodes/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | knime-python3-nodes.jar,\ 3 | LICENSE.TXT,\ 4 | CHANGELOG.md,\ 5 | plugin.xml,\ 6 | src/main/python/ 7 | src.includes = LICENSE.TXT 8 | src.excludes = src/main/python/ 9 | source.knime-python3-nodes.jar = src/main/java/ 10 | output.knime-python3-nodes.jar = target/classes 11 | jars.extra.classpath = platform:/plugin/org.knime.core/lib/schemas.jar 12 | pom.model.property.sonar.sources=src/ -------------------------------------------------------------------------------- /org.knime.python3.nodes/documentation-files/basic.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1a198cfe9c13f3108234b20ec741be1d9816229932e96cd7d8edbf2987543bc8 3 | size 28614 4 | -------------------------------------------------------------------------------- /org.knime.python3.nodes/src/main/python/_port_impl.py: -------------------------------------------------------------------------------- 1 | import json 2 | from typing import Generic, Optional, Type, TypeVar 3 | import knime.api.schema as ks 4 | import datetime as dt 5 | import knime.extension.ports as kpo 6 | 7 | 8 | #### Credentials 9 | 10 | 11 | class _PythonCredentialPortObject: 12 | def __init__(self, spec: ks.CredentialPortObjectSpec): 13 | self._spec = spec 14 | 15 | @property 16 | def spec(self) -> ks.CredentialPortObjectSpec: 17 | return self._spec 18 | 19 | def get_auth_schema(self) -> str: 20 | return self._spec.auth_schema 21 | 22 | def get_auth_parameters(self) -> str: 23 | return self._spec.auth_parameters 24 | 25 | def get_expires_after(self) -> Optional[dt.datetime]: 26 | return self._spec.expires_after 27 | 28 | 29 | CREDENTIAL_OBJ = TypeVar("CREDENTIAL_OBJ", bound=_PythonCredentialPortObject) 30 | 31 | CREDENTIAL_SPEC = TypeVar("CREDENTIAL_SPEC", bound=ks.CredentialPortObjectSpec) 32 | 33 | 34 | class CredentialConverter( 35 | Generic[CREDENTIAL_OBJ, CREDENTIAL_SPEC], 36 | kpo.PortObjectConverter[ 37 | CREDENTIAL_OBJ, 38 | kpo.StringIntermediateRepresentation, 39 | CREDENTIAL_SPEC, 40 | kpo.StringIntermediateRepresentation, 41 | ], 42 | ): 43 | def __init__( 44 | self, 45 | obj_type: Type[CREDENTIAL_OBJ] = _PythonCredentialPortObject, 46 | spec_type: Type[CREDENTIAL_SPEC] = ks.CredentialPortObjectSpec, 47 | ) -> None: 48 | super().__init__(obj_type, spec_type) 49 | 50 | def decode_object( 51 | self, 52 | intermediate_representation: kpo.EmptyIntermediateRepresentation, 53 | spec: CREDENTIAL_SPEC, 54 | ) -> CREDENTIAL_OBJ: 55 | return self.object_type(spec) 56 | 57 | def encode_object( 58 | self, port_object: CREDENTIAL_OBJ 59 | ) -> kpo.EmptyIntermediateRepresentation: 60 | return kpo.EmptyIntermediateRepresentation() 61 | 62 | def decode_spec( 63 | self, intermediate_representation: kpo.StringIntermediateRepresentation 64 | ) -> CREDENTIAL_SPEC: 65 | data = intermediate_representation.getStringRepresentation() 66 | return self.spec_type.deserialize(json.loads(data)) 67 | 68 | def encode_spec( 69 | self, spec: CREDENTIAL_SPEC 70 | ) -> kpo.StringIntermediateRepresentation: 71 | return kpo.StringIntermediateRepresentation(json.dumps(spec.serialize())) 72 | 73 | 74 | #### Hub Authentication 75 | 76 | 77 | class _PythonHubAuthenticationPortObject(_PythonCredentialPortObject): 78 | @property 79 | def spec(self) -> ks.HubAuthenticationPortObjectSpec: 80 | return self._spec 81 | 82 | 83 | class HubAuthenticationConverter( 84 | CredentialConverter[ 85 | _PythonHubAuthenticationPortObject, ks.HubAuthenticationPortObjectSpec 86 | ] 87 | ): 88 | def __init__(self) -> None: 89 | super().__init__( 90 | _PythonHubAuthenticationPortObject, ks.HubAuthenticationPortObjectSpec 91 | ) 92 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.scripting.nodes.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes.tests/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.scripting.nodes.tests 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Unit Tests for org.knime.python3.scripting.nodes 4 | Bundle-SymbolicName: org.knime.python3.scripting.nodes.tests;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Fragment-Host: org.knime.python3.scripting.nodes;bundle-version="[5.5.0,6.0.0)" 10 | Require-Bundle: org.junit;bundle-version="[4.13.0,5.0.0)" 11 | Automatic-Module-Name: org.knime.python3.scripting.nodes.tests 12 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes.tests/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | LICENSE.TXT 4 | src.includes = LICENSE.TXT 5 | source.. = src/test/java/ 6 | output.. = target/classes/ 7 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes.tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.knime 5 | knime-python 6 | ${revision}${changelist} 7 | 8 | org.knime.python3.scripting.nodes.tests 9 | eclipse-test-plugin 10 | 11 | 12 | 5.5.0 13 | 14 | src 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.tycho 21 | target-platform-configuration 22 | ${tycho.version} 23 | 24 | 25 | 26 | 27 | eclipse-feature 28 | org.knime.features.clfixes 29 | 0.0.0 30 | 31 | 32 | 33 | eclipse-feature 34 | org.knime.features.core.columnar 35 | 0.0.0 36 | 37 | 38 | 39 | 40 | 41 | 42 | org.eclipse.tycho 43 | tycho-surefire-plugin 44 | ${tycho.version} 45 | 46 | ${failsafeArgLine} ${knime.tycho.test.configuration} 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.scripting.nodes 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.ManifestBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.SchemaBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.jdt.core.javanature 32 | org.eclipse.pde.PluginNature 33 | 34 | 35 | 36 | 1618234189428 37 | 38 | 30 39 | 40 | org.eclipse.core.resources.regexFilterMatcher 41 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.scripting.nodes 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: KNIME Python 3 - Scripting Nodes 4 | Bundle-SymbolicName: org.knime.python3.scripting.nodes;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: knime-python3-scripting-nodes.jar 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Bundle-ActivationPolicy: lazy 10 | Require-Bundle: org.knime.core;bundle-version="[5.5.0,6.0.0)", 11 | org.knime.base;bundle-version="[5.5.0,6.0.0)", 12 | org.knime.core.columnar.arrow;bundle-version="[5.5.0,6.0.0)", 13 | org.knime.core.columnar;bundle-version="[5.5.0,6.0.0)", 14 | org.knime.core.table;bundle-version="[5.5.0,6.0.0)", 15 | org.knime.python2;bundle-version="[5.5.0,6.0.0)", 16 | org.knime.python2.nodes;bundle-version="[5.5.0,6.0.0)", 17 | org.knime.python3.scripting;bundle-version="[5.5.0,6.0.0)", 18 | org.knime.python3.types;bundle-version="[5.5.0,6.0.0)", 19 | org.knime.python3;bundle-version="[5.5.0,6.0.0)", 20 | org.knime.python3.views;bundle-version="[5.5.0,6.0.0)", 21 | org.knime.python3.arrow;bundle-version="[5.5.0,6.0.0)", 22 | org.knime.ext.py4j;bundle-version="[0.10.9.2,1.0.0)", 23 | org.knime.scripting.editor;bundle-version="[5.5.0,6.0.0)", 24 | org.eclipse.ui;bundle-version="3.119.0", 25 | org.knime.conda;bundle-version="[5.5.0,6.0.0)", 26 | org.knime.conda.envbundling;bundle-version="[5.5.0,6.0.0)", 27 | org.knime.core.ui;bundle-version="[5.5.0,6.0.0)", 28 | org.knime.workbench.editor;bundle-version="[5.5.0,6.0.0)", 29 | org.apache.batik.util;bundle-version="[1.16.0,2.0.0)", 30 | org.apache.batik.dom;bundle-version="[1.16.0,2.0.0)", 31 | org.apache.batik.anim;bundle-version="[1.16.0,2.0.0)", 32 | org.apache.batik.dom.svg;bundle-version="[1.16.0,2.0.0)", 33 | org.knime.ext.svg;bundle-version="[5.5.0,6.0.0)", 34 | com.equo.chromium;bundle-version="95.0.6", 35 | com.google.guava;bundle-version="[19.0.0,20.0.0)", 36 | com.google.gson;bundle-version="2.8.6", 37 | org.apache.commons.lang3;bundle-version="3.9.0", 38 | com.fasterxml.jackson.core.jackson-annotations;bundle-version="2.13.2", 39 | com.fasterxml.jackson.core.jackson-core;bundle-version="2.13.2", 40 | com.fasterxml.jackson.core.jackson-databind;bundle-version="2.13.2", 41 | org.eclipse.orbit.xml-apis-ext;bundle-version="[1.0.0,2.0.0)", 42 | org.apache.commons.commons-io;bundle-version="[2.15.1,3.0.0)" 43 | Automatic-Module-Name: org.knime.python3.scripting.nodes 44 | Export-Package: org.knime.python3.scripting.nodes.prefs 45 | Eclipse-RegisterBuddy: org.knime.ext.py4j 46 | Eclipse-BundleShape: dir 47 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | knime-python3-scripting-nodes.jar,\ 3 | LICENSE.TXT,\ 4 | CHANGELOG.md,\ 5 | plugin.xml,\ 6 | icons/,\ 7 | templates/,\ 8 | js-src/dist/,\ 9 | python-kernel-tester/,\ 10 | src/main/python/ 11 | src.includes = LICENSE.TXT,\ 12 | src/main/python/,\ 13 | python-kernel-tester/ 14 | source.knime-python3-scripting-nodes.jar = src/main/java/ 15 | output.knime-python3-scripting-nodes.jar = target/classes/ 16 | bin.excludes = maven.properties 17 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/icons/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/org.knime.python3.scripting.nodes/icons/python.png -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | # matching Prettier defaults, see https://prettier.io/docs/en/configuration.html#editorconfig 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | insert_final_newline = true 8 | end_of_line = lf 9 | indent_style = space 10 | indent_size = 2 11 | max_line_length = 80 -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | // This is a workaround for https://github.com/eslint/eslint/issues/3458 2 | require("@rushstack/eslint-patch/modern-module-resolution"); 3 | 4 | module.exports = { 5 | extends: [ 6 | "@knime/eslint-config/vue3-typescript", 7 | "@knime/eslint-config/vitest", 8 | ], 9 | globals: { 10 | consola: true, 11 | }, 12 | settings: { 13 | "import/resolver": { 14 | "eslint-import-resolver-custom-alias": { 15 | alias: { 16 | "@": "./src", 17 | }, 18 | }, 19 | }, 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | .DS_Store 12 | dist 13 | dist-ssr 14 | coverage 15 | *.local 16 | 17 | /cypress/videos/ 18 | /cypress/screenshots/ 19 | 20 | # Editor directories and files 21 | .vscode/* 22 | !.vscode/extensions.json 23 | .idea 24 | *.suo 25 | *.ntvs* 26 | *.njsproj 27 | *.sln 28 | *.sw? 29 | 30 | # Test outputs 31 | test/*/reports 32 | test-results/ 33 | 34 | # Optional eslint/stylelint cache 35 | .eslintcache 36 | .stylelintcache 37 | bom.json 38 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | cd org.knime.python3.scripting.nodes/js-src && npx lint-staged || exit 0 -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/.husky/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ./org.knime.python3.scripting.nodes/js-src/node_modules/.bin/knime-eslint-config-prepare-commit-msg "$@" -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/.prettierignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | coverage 3 | test-results 4 | dist 5 | .vscode 6 | CHANGELOG.md 7 | target 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/.prettierrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/.stylelintignore: -------------------------------------------------------------------------------- 1 | build/ 2 | coverage/ 3 | dist/ 4 | target/ 5 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/.stylelintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["@knime/eslint-config/stylelint/vue"], 3 | }; 4 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/README.md: -------------------------------------------------------------------------------- 1 | # Python Scripting Editor 2 | 3 | The scripting editor dialog for the Python scripting nodes. 4 | 5 | ## Recommended IDE Setup 6 | 7 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). 8 | 9 | ## Project Setup 10 | 11 | ```sh 12 | npm install 13 | ``` 14 | 15 | ### Link the @knime/scripting-editor dependency 16 | 17 | To use local changes to the [`@knime/scripting-editor`](https://bitbucket.org/KNIME/knime-scripting-editor/src/master/org.knime.scripting.editor.js/) package it has to be linked with [`npm-link`](https://docs.npmjs.com/cli/v9/commands/npm-link). 18 | 19 | ### Compile and Hot-Reload for Development 20 | 21 | If linked with `@knime/scripting-editor`, automatically build changes in `@knime/scripting-editor` with 22 | 23 | ```sh 24 | npm run build-watch # pwd: .../knime-scripting-editor/org.knime.scripting.editor.js/ 25 | ``` 26 | 27 | #### Mocked Browser Preview 28 | 29 | ```sh 30 | npm run dev:browser 31 | ``` 32 | 33 | #### KNIME Dialog Development Mode 34 | 35 | Start KNIME Analytics Platform with the arguments 36 | 37 | ``` 38 | -Dchromium.remote_debugging_port=8988 39 | -Dorg.knime.ui.dev.node.dialog.url=http://localhost:5173/ 40 | ``` 41 | 42 | Run the development server 43 | 44 | ```sh 45 | npm run dev:knime 46 | ``` 47 | 48 | ### Type-Check, Compile and Minify for Production 49 | 50 | ```sh 51 | npm run build 52 | ``` 53 | 54 | ### Run Unit Tests with [Vitest](https://vitest.dev/) 55 | 56 | ```sh 57 | npm run test:unit 58 | ``` 59 | 60 | ### Lint with [ESLint](https://eslint.org/) 61 | 62 | ```sh 63 | npm run lint 64 | ``` 65 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Python Scripting Editor 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/lint-staged.config.mjs: -------------------------------------------------------------------------------- 1 | import config from "@knime/eslint-config/lint-staged.config.mjs"; 2 | 3 | export default config; 4 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "python-scripting-editor", 3 | "version": "0.0.0", 4 | "private": true, 5 | "type": "module", 6 | "scripts": { 7 | "dev": "npm run dev:knime", 8 | "dev:knime": "vite", 9 | "dev:browser": "vite --mode development.browser", 10 | "build": "run-p type-check build-only", 11 | "build-only": "vite build", 12 | "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", 13 | "format": "prettier --cache --write .", 14 | "format:check": "prettier --cache --check .", 15 | "lint": "run-p 'lint:* -- --fix'", 16 | "lint:js": "eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts", 17 | "lint:css": "stylelint --cache '**/*.{css,vue}'", 18 | "ci:lint-format": "run-p ci:lint:* format:check -c", 19 | "ci:lint:js": "npm run lint:js && npm run lint:js -- -f json -o test-results/eslint.json", 20 | "ci:lint:css": "npm run lint:css -- -f json -o test-results/stylelint.json", 21 | "jenkins:lint": "eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts -f json -o target/eslint.json || true; stylelint '**/*.css' -f json -o target/stylelint.json || true", 22 | "audit": "npm audit --omit dev", 23 | "test:unit": "vitest", 24 | "coverage": "vitest run --coverage", 25 | "prepare": "cd ../.. && husky ./org.knime.python3.scripting.nodes/js-src/.husky", 26 | "sbom": "npx @cyclonedx/cyclonedx-npm --output-file bom.json --ignore-npm-errors --omit dev", 27 | "postinstall": "license-check -c" 28 | }, 29 | "dependencies": { 30 | "@knime/components": "^1.17.1", 31 | "@knime/scripting-editor": "0.0.103", 32 | "@knime/styles": "^1.2.0", 33 | "@knime/ui-extension-service": "2.1.1", 34 | "@vueuse/core": "11.1.0", 35 | "consola": "2.15.3", 36 | "vue": "3.4.27" 37 | }, 38 | "devDependencies": { 39 | "@cyclonedx/cyclonedx-npm": "1.19.3", 40 | "@knime/eslint-config": "8.3.0", 41 | "@knime/licenses": "^1.1.0", 42 | "@rushstack/eslint-patch": "1.10.4", 43 | "@tsconfig/node22": "22.0.0", 44 | "@types/jsdom": "21.1.7", 45 | "@types/lodash-es": "^4.17.12", 46 | "@types/node": "22.10.10", 47 | "@vitejs/plugin-vue": "5.1.4", 48 | "@vitest/coverage-v8": "2.1.1", 49 | "@vue/eslint-config-prettier": "9.0.0", 50 | "@vue/eslint-config-typescript": "13.0.0", 51 | "@vue/test-utils": "2.4.6", 52 | "@vue/tsconfig": "0.5.1", 53 | "eslint": "8.57.0", 54 | "eslint-plugin-vue": "9.26.0", 55 | "husky": "9.1.6", 56 | "jsdom": "25.0.1", 57 | "npm-run-all": "4.1.5", 58 | "postcss-preset-env": "^10.0.5", 59 | "prettier": "3.3.3", 60 | "stylelint": "16.14.1", 61 | "typescript": "5.6.2", 62 | "vite": "5.4.8", 63 | "vite-plugin-monaco-editor": "1.1.0", 64 | "vite-svg-loader": "5.1.0", 65 | "vitest": "2.1.1", 66 | "vitest-canvas-mock": "0.3.3", 67 | "vue-tsc": "2.1.6" 68 | }, 69 | "engines": { 70 | "node": "22.x" 71 | }, 72 | "volta": { 73 | "node": "22.11.0", 74 | "npm": "10.9.1" 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | const { preset } = require("@knime/styles/config/postcss.config.cjs"); 2 | 3 | module.exports = { 4 | plugins: { 5 | "postcss-preset-env": preset, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/preview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The preview is not available in DEV mode. 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/public/assets/plot-placeholder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/__mocks__/browser-mock-services.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getInitialDataService, 3 | getScriptingService, 4 | getSettingsService, 5 | } from "@knime/scripting-editor"; 6 | import { createInitialDataServiceMock } from "@knime/scripting-editor/initial-data-service-browser-mock"; 7 | import { createScriptingServiceMock } from "@knime/scripting-editor/scripting-service-browser-mock"; 8 | import { createSettingsServiceMock } from "@knime/scripting-editor/settings-service-browser-mock"; 9 | 10 | import { DEFAULT_INITIAL_DATA, DEFAULT_INITIAL_SETTINGS } from "./mock-data"; 11 | 12 | if (import.meta.env.MODE === "development.browser") { 13 | const scriptingService = createScriptingServiceMock({ 14 | sendToServiceMockResponses: { 15 | getLanguageServerConfig: () => Promise.resolve(JSON.stringify({})), 16 | }, 17 | }); 18 | 19 | const initialDataService = createInitialDataServiceMock(DEFAULT_INITIAL_DATA); 20 | const settingsService = createSettingsServiceMock(DEFAULT_INITIAL_SETTINGS); 21 | 22 | Object.assign(getInitialDataService(), initialDataService); 23 | Object.assign(getScriptingService(), scriptingService); 24 | Object.assign(getSettingsService(), settingsService); 25 | } 26 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/__mocks__/executable-options.ts: -------------------------------------------------------------------------------- 1 | export const executableOptionsMock = [ 2 | { 3 | type: "PREF_BUNDLED", 4 | id: "", 5 | pythonExecutable: "/foo/bar/python", 6 | condaEnvName: null, 7 | condaEnvDir: null, 8 | }, 9 | { 10 | type: "CONDA_ENV_VAR", 11 | id: "conda.environment1", 12 | pythonExecutable: 13 | "/opt/homebrew/Caskroom/miniconda/base/envs/conda_environment1/bin/python", 14 | condaEnvName: "conda_environment", 15 | condaEnvDir: "/opt/homebrew/Caskroom/miniconda/base/envs/conda_environment", 16 | }, 17 | { 18 | type: "CONDA_ENV_VAR", 19 | id: "conda.environment2", 20 | pythonExecutable: 21 | "/opt/homebrew/Caskroom/miniconda/base/envs/conda_environment2/bin/python", 22 | condaEnvName: "conda_environment", 23 | condaEnvDir: "/opt/homebrew/Caskroom/miniconda/base/envs/conda_environment", 24 | }, 25 | ]; 26 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/__mocks__/monaco-editor.ts: -------------------------------------------------------------------------------- 1 | import { vi } from "vitest"; 2 | 3 | export const MarkerTag = {}; 4 | export const MarkerSeverity = {}; 5 | export const languages = { 6 | CompletionItemKind: { 7 | Snippet: 0, 8 | }, 9 | registerCompletionItemProvider: vi.fn(), 10 | }; 11 | export const editor = { 12 | getModel: vi.fn(() => ({ 13 | getValue: () => "foo", 14 | setValue: vi.fn(), 15 | isAttachedToEditor: () => false, 16 | onDidChangeContent: vi.fn(), 17 | updateOptions: vi.fn(), 18 | dispose: vi.fn(), 19 | })), 20 | createModel: vi.fn(), 21 | create: vi.fn(() => ({ 22 | onDidChangeCursorSelection: vi.fn(), 23 | onDidPaste: vi.fn(), 24 | dispose: vi.fn(), 25 | updateOptions: vi.fn(), 26 | addCommand: vi.fn(), 27 | })), 28 | }; 29 | export const Uri = { 30 | parse: vi.fn(), 31 | }; 32 | export const KeyCode = { 33 | Enter: 0b11, 34 | }; 35 | export const KeyMod = { 36 | CtrlCmd: 0b100, 37 | Shift: 0b1000, 38 | }; 39 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/__tests__/store.test.ts: -------------------------------------------------------------------------------- 1 | import { beforeEach, describe, expect, it, vi } from "vitest"; 2 | 3 | import { consoleHandler } from "@knime/scripting-editor"; 4 | 5 | import { DEFAULT_INITIAL_DATA } from "@/__mocks__/mock-data"; 6 | import { getPythonInitialDataService } from "@/python-initial-data-service"; 7 | 8 | describe("store.ts", () => { 9 | beforeEach(() => { 10 | vi.restoreAllMocks(); 11 | }); 12 | 13 | describe("sessionStatusStore", () => { 14 | const importSessionStatusStore = async () => 15 | (await import("@/store")).useSessionStatusStore(); 16 | 17 | beforeEach(() => { 18 | vi.resetModules(); 19 | }); 20 | 21 | it("should set isRunningSupported to true if inputs are available", async () => { 22 | const sessionStatus = await importSessionStatusStore(); 23 | expect(sessionStatus.isRunningSupported).toBe(true); 24 | }); 25 | 26 | it("should set isRunningSupported to false if no inputs are available", async () => { 27 | vi.mocked(getPythonInitialDataService).mockReturnValue({ 28 | getInitialData: () => 29 | Promise.resolve({ 30 | ...DEFAULT_INITIAL_DATA, 31 | inputConnectionInfo: [ 32 | { status: "OK", isOptional: false }, 33 | { status: "UNEXECUTED_CONNECTION", isOptional: false }, 34 | ], 35 | }), 36 | }); 37 | const sessionStatus = await importSessionStatusStore(); 38 | expect(sessionStatus.isRunningSupported).toBe(false); 39 | }); 40 | 41 | it("should log warning if no inputs are available", async () => { 42 | vi.mocked(getPythonInitialDataService).mockReturnValue({ 43 | getInitialData: () => 44 | Promise.resolve({ 45 | ...DEFAULT_INITIAL_DATA, 46 | inputConnectionInfo: [ 47 | { status: "OK", isOptional: false }, 48 | { status: "UNEXECUTED_CONNECTION", isOptional: false }, 49 | ], 50 | }), 51 | }); 52 | 53 | const consoleSpy = vi.spyOn(consoleHandler, "writeln"); 54 | 55 | await importSessionStatusStore(); 56 | 57 | expect(consoleSpy).toHaveBeenCalledOnce(); 58 | expect(consoleSpy).toHaveBeenCalledWith({ 59 | warning: 60 | "Missing input data. Connect all input ports and execute preceding nodes to enable script execution.", 61 | }); 62 | }); 63 | }); 64 | }); 65 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/components/LastActionStatus.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 34 | 35 | 36 | {{ executionStatusText.text }} 37 | 38 | 39 | 40 | 75 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/components/PythonViewPreview.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 27 | 28 | 34 | 35 | 39 | 40 | Please run the code to see the preview. 41 | 42 | 43 | The view cannot be displayed. Please check the error message and 44 | re-execute the script. 45 | 46 | 47 | Run code 57 | 58 | 59 | 60 | 61 | 93 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/components/PythonWorkspaceBody.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 25 | 26 | 33 | 34 | {{ variable.name }} 35 | 36 | 37 | {{ variable.type }} 38 | 39 | 40 | {{ variable.value }} 41 | 42 | 43 | 44 | 45 | 46 | 80 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/main.ts: -------------------------------------------------------------------------------- 1 | import "@/__mocks__/browser-mock-services"; 2 | 3 | import { createApp } from "vue"; 4 | import { BrowserReporter, Consola, LogLevel } from "consola"; 5 | 6 | import App from "@/components/App.vue"; 7 | 8 | const setupConsola = () => { 9 | const consola = new Consola({ 10 | level: import.meta.env.DEV ? LogLevel.Trace : LogLevel.Error, 11 | reporters: [new BrowserReporter()], 12 | }); 13 | const globalObject = typeof global === "object" ? global : window; 14 | 15 | // @ts-expect-error 16 | globalObject.consola = consola; 17 | }; 18 | 19 | setupConsola(); 20 | 21 | const app = createApp(App); 22 | 23 | app.mount("#app"); 24 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/python-initial-data-service.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type GenericInitialData, 3 | type InputOutputModel, 4 | getInitialDataService, 5 | } from "@knime/scripting-editor"; 6 | 7 | import type { ExecutableOption } from "./types/common"; 8 | 9 | export type PythonInitialData = GenericInitialData & { 10 | hasPreview: boolean; 11 | outputObjects: InputOutputModel[]; 12 | executableOptionsList: ExecutableOption[]; 13 | }; 14 | 15 | export const getPythonInitialDataService = () => ({ 16 | ...getInitialDataService(), 17 | getInitialData: async () => 18 | (await getInitialDataService().getInitialData()) as PythonInitialData, 19 | }); 20 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/python-settings-service.ts: -------------------------------------------------------------------------------- 1 | import { getSettingsService } from "@knime/scripting-editor"; 2 | 3 | import type { PythonScriptingNodeSettings } from "./types/common"; 4 | 5 | export const getPythonSettingsService = () => ({ 6 | ...getSettingsService(), 7 | getSettings: async () => 8 | (await getSettingsService().getSettings()) as PythonScriptingNodeSettings, 9 | }); 10 | 11 | export type PythonSettingsService = ReturnType; 12 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/test-setup/setup.ts: -------------------------------------------------------------------------------- 1 | import "vitest-canvas-mock"; 2 | import { vi } from "vitest"; 3 | import { Consola, LogLevel } from "consola"; 4 | 5 | import { 6 | DEFAULT_INITIAL_DATA, 7 | DEFAULT_INITIAL_SETTINGS, 8 | } from "@/__mocks__/mock-data"; 9 | 10 | export const consola = new Consola({ 11 | level: LogLevel.Log, 12 | }); 13 | 14 | // NB: We do not use importActual here, because we want to ensure everything is mocked. 15 | // Not mocking something can lead randomly appearing timeout errors because of the 16 | // `getConfig` call of the ui-extension-service. 17 | vi.mock("@knime/ui-extension-service", () => { 18 | const dialogService = { 19 | registerSettings: vi.fn(() => 20 | vi.fn(() => ({ 21 | setValue: vi.fn(), 22 | addControllingFlowVariable: vi.fn(() => ({ 23 | set: vi.fn(), 24 | unset: vi.fn(), 25 | })), 26 | })), 27 | ), 28 | setApplyListener: vi.fn(), 29 | getInitialDisplayMode: vi.fn(() => "large"), 30 | addOnDisplayModeChangeCallback: vi.fn(), 31 | }; 32 | 33 | return { 34 | JsonDataService: { 35 | getInstance: vi.fn(() => 36 | Promise.resolve({ 37 | initialData: vi.fn(() => 38 | Promise.resolve({ 39 | settings: DEFAULT_INITIAL_SETTINGS, 40 | initialData: DEFAULT_INITIAL_DATA, 41 | }), 42 | ), 43 | }), 44 | ), 45 | }, 46 | ReportingService: vi.fn(() => ({})), 47 | DialogService: { getInstance: vi.fn(() => Promise.resolve(dialogService)) }, 48 | }; 49 | }); 50 | 51 | vi.mock("@/python-initial-data-service", () => ({ 52 | getPythonInitialDataService: vi.fn(() => ({ 53 | getInitialData: vi.fn(() => Promise.resolve(DEFAULT_INITIAL_DATA)), 54 | })), 55 | })); 56 | 57 | vi.mock("@/python-settings-service", () => ({ 58 | getPythonSettingsService: vi.fn(() => ({ 59 | getSettings: vi.fn(() => Promise.resolve(DEFAULT_INITIAL_SETTINGS)), 60 | registerSettingsGetterForApply: vi.fn(() => Promise.resolve()), 61 | })), 62 | })); 63 | 64 | vi.mock("@knime/scripting-editor", async (importActual) => { 65 | const languageServerConnection = { changeConfiguration: vi.fn() }; 66 | const mockScriptingService = { 67 | sendToService: vi.fn((args) => { 68 | // If this method is not mocked, the tests fail with a hard to debug 69 | // error otherwise, so we're really explicit here. 70 | throw new Error( 71 | `ScriptingService.sendToService should have been mocked for method ${args}`, 72 | ); 73 | }), 74 | registerEventHandler: vi.fn(), 75 | connectToLanguageServer: vi.fn(() => languageServerConnection), 76 | }; 77 | 78 | const scriptEditorModule = (await importActual()) as any; 79 | 80 | return { 81 | ...scriptEditorModule, 82 | getScriptingService: vi.fn(() => { 83 | return mockScriptingService; 84 | }), 85 | }; 86 | }); 87 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/types/common.ts: -------------------------------------------------------------------------------- 1 | export type ExecutableOptionType = 2 | | "PREF_BUNDLED" 3 | | "PREF_CONDA" 4 | | "PREF_MANUAL" 5 | | "CONDA_ENV_VAR" 6 | | "STRING_VAR" 7 | | "MISSING_VAR"; 8 | 9 | export type ExecutableOption = { 10 | type: ExecutableOptionType; 11 | id: string; 12 | pythonExecutable: string; 13 | condaEnvName: string; 14 | condaEnvDir: string; 15 | }; 16 | 17 | export type PythonScriptingNodeSettings = { 18 | script: string; 19 | executableSelection: string; 20 | scriptUsedFlowVariable?: string; 21 | settingsAreOverriddenByFlowVariable?: boolean; 22 | }; 23 | 24 | export type Workspace = { 25 | name: string; 26 | type: string; 27 | value: string; 28 | }[]; 29 | 30 | export type ExecutionResult = 31 | | "SUCCESS" 32 | | "EXECUTION_ERROR" 33 | | "KNIME_ERROR" 34 | | "FATAL_ERROR" 35 | | "CANCELLED"; 36 | 37 | export type ExecutionInfo = { 38 | status: ExecutionResult; 39 | description: string; 40 | traceback?: string[]; 41 | data?: Workspace; 42 | hasValidView?: boolean; 43 | }; 44 | 45 | export type KillSessionInfo = { 46 | status: "SUCCESS" | "ERROR"; 47 | description: string; 48 | }; 49 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | 6 | declare module "*.vue" { 7 | import { DefineComponent } from "vue"; 8 | const component: DefineComponent<{}, {}, any>; 9 | export default component; 10 | } 11 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "include": ["src/**/*", "src/**/*.vue", "node_modules/@knime/**/*.vue"], 4 | "exclude": [ 5 | "**/__tests__/*", 6 | "**/__mocks__/*", 7 | "node_modules/@knime/scripting-editor/**/*" 8 | ], 9 | "compilerOptions": { 10 | "lib": ["ES2023", "DOM", "DOM.Iterable"], 11 | "baseUrl": ".", 12 | "paths": { 13 | "@/*": ["./src/*"] 14 | }, 15 | "strict": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.node.json" 6 | }, 7 | { 8 | "path": "./tsconfig.app.json" 9 | }, 10 | { 11 | "path": "./tsconfig.vitest.json" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node22/tsconfig.json", 3 | "include": [ 4 | "vite.config.*", 5 | "vitest.config.*", 6 | "cypress.config.*", 7 | "nightwatch.conf.*", 8 | "playwright.config.*" 9 | ], 10 | "compilerOptions": { 11 | "composite": true, 12 | "module": "ESNext", 13 | "moduleResolution": "Bundler", 14 | "types": ["node"] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/tsconfig.vitest.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.app.json", 3 | "exclude": ["node_modules/@knime/scripting-editor/**/*"], 4 | "compilerOptions": { 5 | "composite": true, 6 | "lib": ["ES2023"], 7 | "types": ["node", "jsdom"] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/js-src/vite.config.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line spaced-comment 2 | /// 3 | import { URL, fileURLToPath } from "node:url"; 4 | 5 | import { defineConfig } from "vite"; 6 | import vue from "@vitejs/plugin-vue"; 7 | import monacoEditorPlugin, { 8 | type IMonacoEditorOpts, 9 | } from "vite-plugin-monaco-editor"; 10 | import svgLoader from "vite-svg-loader"; 11 | 12 | // @ts-ignore 13 | import { svgoConfig } from "@knime/styles/config/svgo.config"; 14 | 15 | // Hack because default export of vite-plugin-monaco-editor is wrong (and does not fit types) 16 | // https://github.com/vdesjs/vite-plugin-monaco-editor/issues/21 17 | const monacoEditorPluginDefault = (monacoEditorPlugin as any).default as ( 18 | options: IMonacoEditorOpts, 19 | ) => any; 20 | 21 | // https://vitejs.dev/config/ 22 | export default defineConfig({ 23 | plugins: [ 24 | vue(), 25 | monacoEditorPluginDefault({ 26 | languageWorkers: ["editorWorkerService"], 27 | }), 28 | svgLoader({ svgoConfig }), 29 | ], 30 | resolve: { 31 | alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) }, 32 | }, 33 | optimizeDeps: { exclude: ["@knime/scripting-editor"] }, 34 | base: "./", 35 | test: { 36 | setupFiles: [ 37 | fileURLToPath(new URL("./src/test-setup/setup.ts", import.meta.url)), 38 | ], 39 | include: ["src/**/__tests__/**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], 40 | exclude: ["**/node_modules/**", "**/dist/**"], 41 | environment: "jsdom", 42 | reporters: ["default"], 43 | root: fileURLToPath(new URL("./", import.meta.url)), 44 | server: { deps: { inline: ["@knime/scripting-editor"] } }, 45 | pool: "threads", 46 | alias: { 47 | "monaco-editor": fileURLToPath( 48 | new URL("./src/__mocks__/monaco-editor", import.meta.url), 49 | ), 50 | }, 51 | coverage: { 52 | provider: "v8", 53 | all: true, 54 | exclude: [ 55 | "coverage/**", 56 | "dist/**", 57 | "lib/**", 58 | "**/*.d.ts", 59 | "**/__tests__/**", 60 | "**/__mocks__/**", 61 | "test-setup/**", 62 | "**/{vite,vitest,postcss,lint-staged}.config.{js,cjs,mjs,ts}", 63 | "**/.{eslint,prettier,stylelint}rc.{js,cjs,yml}", 64 | ], 65 | reporter: ["html", "text", "lcov"], 66 | }, 67 | }, 68 | }); 69 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 16 | 19 | 20 | 22 | 24 | 25 | 26 | 28 | 33 | 34 | 35 | 37 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 48 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes/script/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes/script/python.png -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes/view/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes/view/python.png -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes2/script/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes2/script/python.png -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes2/view/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes2/view/python.png -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-script/Working with a pandas.DataFrame.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-script/Working with a pyarrow.Table.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-script/Working with batches (pandas.DataFrame).xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-script/Working with batches (pyarrow.RecordBatch).xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-view/Viewing a JPEG image.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-view/Viewing a PNG image.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-view/Viewing a matplotlib plot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-view/Viewing a network with pyvis.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-view/Viewing a plotly plot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-view/Viewing a shapely geometry object.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.nodes/templates/python3-view/Viewing an HTML page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.py4j.dependencies/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.py4j.dependencies/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.scripting.py4j.dependencies 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.py4j.dependencies/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.py4j.dependencies/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey= 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.py4j.dependencies/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: KNIME Python 3 Scripting - Additional Dependencies of OSGi Wrapper for py4j 4 | Bundle-SymbolicName: org.knime.python3.scripting.py4j.dependencies;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Fragment-Host: org.knime.ext.py4j;bundle-version="[0.10.9.2,0.11.0)" 10 | Automatic-Module-Name: org.knime.python3.scripting.py4j.dependencies 11 | Require-Bundle: org.knime.core.table;bundle-version="[5.5.0,6.0.0)", 12 | org.knime.python2;bundle-version="[5.5.0,6.0.0)" 13 | 14 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.py4j.dependencies/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | CHANGELOG.md,\ 4 | LICENSE.TXT 5 | src.includes = LICENSE.TXT 6 | bin.excludes = maven.properties 7 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.scripting.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/.settings/org.sonar.ide.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | analyseLocally=false 2 | eclipse.preferences.version=1 3 | extraProperties= 4 | lastAnalysisDate=1379455933000 5 | projectKey=org.knime.core 6 | serverUrl=https\://sonar.knime.org 7 | version=2 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.scripting.tests 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Unit Tests for org.knime.python3.scripting 4 | Bundle-SymbolicName: org.knime.python3.scripting.tests;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Fragment-Host: org.knime.python3.scripting;bundle-version="[5.5.0,6.0.0)" 10 | Automatic-Module-Name: org.knime.python3.scripting.tests 11 | Export-Package: org.knime.python3.scripting 12 | Require-Bundle: org.junit;bundle-version="[4.13.0,5.0.0)", 13 | org.apache.arrow.memory-core;bundle-version="[18.1.0,19.0.0)", 14 | org.knime.python3.testing;bundle-version="[5.5.0,6.0.0)" 15 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | LICENSE.TXT,\ 4 | src/test/python/ 5 | src.includes = LICENSE.TXT 6 | src.excludes = src/test/python/ 7 | source.. = src/test/java/ 8 | output.. = target/classes/ 9 | bin.excludes = maven.properties 10 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.knime 5 | knime-python 6 | ${revision}${changelist} 7 | 8 | org.knime.python3.scripting.tests 9 | eclipse-test-plugin 10 | 11 | 12 | 5.5.0 13 | 14 | src 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.tycho 21 | target-platform-configuration 22 | ${tycho.version} 23 | 24 | 25 | 26 | 27 | eclipse-feature 28 | org.knime.features.clfixes 29 | 0.0.0 30 | 31 | 32 | 33 | eclipse-feature 34 | org.knime.features.core.columnar 35 | 0.0.0 36 | 37 | 38 | 39 | 40 | 41 | 42 | org.eclipse.tycho 43 | tycho-surefire-plugin 44 | ${tycho.version} 45 | 46 | ${failsafeArgLine} ${knime.tycho.test.configuration} 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/src/test/java/org/knime/python3/scripting/PythonTestResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------------------------------ 3 | * 4 | * Copyright by KNIME AG, Zurich, Switzerland 5 | * Website: http://www.knime.com; Email: contact@knime.com 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License, Version 3, as 9 | * published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | * 19 | * Additional permission under GNU GPL version 3 section 7: 20 | * 21 | * KNIME interoperates with ECLIPSE solely via ECLIPSE's plug-in APIs. 22 | * Hence, KNIME and ECLIPSE are both independent programs and are not 23 | * derived from each other. Should, however, the interpretation of the 24 | * GNU GPL Version 3 ("License") under any applicable laws result in 25 | * KNIME and ECLIPSE being a combined program, KNIME AG herewith grants 26 | * you the additional permission to use and propagate KNIME together with 27 | * ECLIPSE with only the license terms in place for ECLIPSE applying to 28 | * ECLIPSE and the GNU GPL Version 3 applying for KNIME, provided the 29 | * license terms of ECLIPSE themselves allow for the respective use and 30 | * propagation of ECLIPSE together with KNIME. 31 | * 32 | * Additional permission relating to nodes for KNIME that extend the Node 33 | * Extension (and in particular that are based on subclasses of NodeModel, 34 | * NodeDialog, and NodeView) and that only interoperate with KNIME through 35 | * standard APIs ("Nodes"): 36 | * Nodes are deemed to be separate and independent programs and to not be 37 | * covered works. Notwithstanding anything to the contrary in the 38 | * License, the License does not apply to Nodes, you are not required to 39 | * license Nodes under the License, and you are granted a license to 40 | * prepare and propagate Nodes, in each case even if such Nodes are 41 | * propagated with or for interoperation with KNIME. The owner of a Node 42 | * may freely choose the license terms applicable to such Node, including 43 | * when such Node is propagated with or for interoperation with KNIME. 44 | * --------------------------------------------------------------------- 45 | * 46 | * History 47 | * Oct 16, 2021 (marcel): created 48 | */ 49 | package org.knime.python3.scripting; 50 | 51 | public interface PythonTestResult { 52 | 53 | boolean wasSuccessful(); 54 | 55 | String getFailureReport(); 56 | } 57 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/src/test/python/knime_testing.py: -------------------------------------------------------------------------------- 1 | from unittest import TextTestResult 2 | 3 | from io import StringIO 4 | 5 | # TODO: we could move this module to a more general plug-in if it proves to be useful for communicating Python unittest 6 | # results back to JUnit 7 | 8 | 9 | class PythonTestResult: 10 | def __init__(self, test_result: TextTestResult): 11 | self._test_result = test_result 12 | 13 | def wasSuccessful(self) -> bool: 14 | return self._test_result.wasSuccessful() 15 | 16 | def getFailureReport(self) -> str: 17 | r = self._test_result 18 | original_stream = r.stream 19 | try: 20 | r.stream = _WritelnDecorator(StringIO()) 21 | r.printErrors() 22 | # TextTestResult's printErrors does not print unexpected successes for some reason, so we do it ourselves. 23 | for test in r.unexpectedSuccesses: 24 | r.stream.writeln(r.separator1) 25 | r.stream.writeln(f"UNEXPECTED SUCCESS: {r.getDescription(test)}") 26 | return r.stream.getvalue() 27 | finally: 28 | r.stream = original_stream 29 | 30 | class Java: 31 | implements = ["org.knime.python3.scripting.PythonTestResult"] 32 | 33 | 34 | class _WritelnDecorator(object): 35 | """ 36 | Modified from unittest.runner._WritelnDecorator. 37 | """ 38 | 39 | def __init__(self, stream): 40 | self.stream = stream 41 | 42 | def __getattr__(self, attr): 43 | return getattr(self.stream, attr) 44 | 45 | def writeln(self, arg=None): 46 | if arg: 47 | self.write(arg) 48 | self.write("\n") 49 | -------------------------------------------------------------------------------- /org.knime.python3.scripting.tests/src/test/python/unittest/test_knime_scripting_io.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import pandas as pd 4 | import knime.scripting.io as knio 5 | import sys 6 | 7 | 8 | class DummyDataSink: 9 | def __enter__(self): 10 | return self 11 | 12 | def __exit__(self, exc_type, exc_val, exc_tb): 13 | self.close() 14 | return False 15 | 16 | def write(self, data): 17 | pass 18 | 19 | def close(self): 20 | pass 21 | 22 | 23 | class NewApiTest(unittest.TestCase): 24 | def setUp(self): 25 | import knime.api.table as ktn 26 | import knime._arrow._table as knat 27 | 28 | ktn._backend = knat._ArrowBackend(lambda: DummyDataSink()) 29 | 30 | def test_new_api_available(self): 31 | df = pd.DataFrame() 32 | df["A"] = [1, 2, 3, 4] 33 | t = knio.Table.from_pandas(df) 34 | 35 | def test_new_batch_api_available(self): 36 | df = pd.DataFrame() 37 | df["A"] = [1, 2, 3, 4] 38 | t = knio.BatchOutputTable.create() 39 | t.append(knio.Table.from_pandas(df)) 40 | t.append(knio.Table.from_pandas(df)) 41 | self.assertEqual(2, t.num_batches) 42 | 43 | 44 | class ApiDeprecationTest(unittest.TestCase): 45 | def setUp(self): 46 | if "knime_io" in sys.modules: 47 | del sys.modules["knime_io"] 48 | if "knime.scripting.io" in sys.modules: 49 | del sys.modules["knime.scripting.io"] 50 | 51 | def test_old_api_warns_about_deprecation(self): 52 | with self.assertWarns(DeprecationWarning): 53 | import knime_io 54 | 55 | del sys.modules["knime_io"] 56 | 57 | def test_cannot_import_knio_after_scripting_io(self): 58 | import knime.scripting.io 59 | 60 | with self.assertRaises(ImportError): 61 | with self.assertWarns(DeprecationWarning): 62 | import knime_io 63 | 64 | def test_cannot_import_scripting_io_after_knio(self): 65 | with self.assertWarns(DeprecationWarning): 66 | import knime_io 67 | 68 | with self.assertRaises(ImportError): 69 | import knime.scripting.io 70 | 71 | 72 | class KnimeKernelTest(unittest.TestCase): 73 | def test_import_knime_kernel(self): 74 | import _kernel_launcher 75 | 76 | del sys.modules["_kernel_launcher"] 77 | 78 | 79 | if __name__ == "__main__": 80 | unittest.main() 81 | -------------------------------------------------------------------------------- /org.knime.python3.scripting/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.knime.python3.scripting/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.scripting 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.ManifestBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.SchemaBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.jdt.core.javanature 32 | org.eclipse.pde.PluginNature 33 | 34 | 35 | 36 | 0 37 | 38 | 30 39 | 40 | org.eclipse.core.resources.regexFilterMatcher 41 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /org.knime.python3.scripting/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//py/DBUtil.py=utf-8 3 | encoding//py/DataTables.py=utf-8 4 | encoding//py/EnvironmentHelper.py=utf-8 5 | encoding//py/JupyterSupport.py=utf-8 6 | encoding//py/PythonCommands.py=utf-8 7 | encoding//py/PythonKernelBase.py=utf-8 8 | encoding//py/PythonKernelLauncher.py=utf-8 9 | encoding//py/PythonKernelTester.py=utf-8 10 | encoding//py/PythonUtils.py=utf-8 11 | encoding//py/ReadWriteLock.py=utf-8 12 | encoding//py/Serializer.py=utf-8 13 | encoding//py/TypeExtensionManager.py=utf-8 14 | encoding//py/debug_util.py=utf-8 15 | encoding//py/jaydebeapi.py=utf-8 16 | encoding//py/messaging/AbstractTaskHandler.py=utf-8 17 | encoding//py/messaging/Message.py=utf-8 18 | encoding//py/messaging/MessageDistributor.py=utf-8 19 | encoding//py/messaging/MessageReceiver.py=utf-8 20 | encoding//py/messaging/MessageSender.py=utf-8 21 | encoding//py/messaging/PythonMessagingBase.py=utf-8 22 | encoding//py/messaging/RequestHandlers.py=utf-8 23 | encoding//py/messaging/Task.py=utf-8 24 | encoding//py/python2/PythonKernel.py=utf-8 25 | encoding//py/python2/SynchronousExecutor.py=utf-8 26 | encoding//py/python2/messaging/PythonMessaging.py=utf-8 27 | encoding//py/python3/PythonKernel.py=utf-8 28 | encoding//py/python3/_ExecutionMonitor.py=utf-8 29 | encoding//py/python3/_QueuedExecutor.py=utf-8 30 | encoding//py/python3/messaging/AbstractMessageLoop.py=utf-8 31 | encoding//py/python3/messaging/MessageDistributorLoop.py=utf-8 32 | encoding//py/python3/messaging/MessageReceiverLoop.py=utf-8 33 | encoding//py/python3/messaging/PythonMessaging.py=utf-8 34 | encoding//py/python3/messaging/testing/MessagingTest.py=utf-8 35 | encoding//src/main/python/org/knime/python3/py_modules/knime/client.py=utf-8 36 | encoding/=UTF-8 37 | -------------------------------------------------------------------------------- /org.knime.python3.scripting/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.scripting 8 | -------------------------------------------------------------------------------- /org.knime.python3.scripting/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: KNIME Python 3 - Scripting 4 | Bundle-SymbolicName: org.knime.python3.scripting;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: knime-python3-scripting.jar 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Bundle-ActivationPolicy: lazy 10 | Require-Bundle: com.google.guava;bundle-version="[19.0.0,20.0.0)", 11 | org.apache.commons.lang3;bundle-version="[3.9.0,4.0.0)", 12 | org.knime.core.table;bundle-version="[5.5.0,6.0.0)", 13 | org.knime.core.columnar;bundle-version="[5.5.0,6.0.0)", 14 | org.knime.core.columnar.arrow;bundle-version="[5.5.0,6.0.0)", 15 | org.knime.core;bundle-version="[5.5.0,6.0.0)", 16 | org.knime.core.data.columnar;bundle-version="[5.5.0,6.0.0)", 17 | org.knime.core.util;bundle-version="[6.5.0,7.0.0)", 18 | org.knime.ext.py4j;bundle-version="[0.10.9.2,1.0.0)", 19 | org.knime.python2;bundle-version="[5.5.0,6.0.0)", 20 | org.knime.python3;bundle-version="[5.5.0,6.0.0)", 21 | org.knime.python3.arrow;bundle-version="[5.5.0,6.0.0)", 22 | org.knime.python3.arrow.types;bundle-version="[5.5.0,6.0.0)", 23 | org.knime.python3.types;bundle-version="[5.5.0,6.0.0)", 24 | org.knime.python3.views;bundle-version="[5.5.0,6.0.0)" 25 | Export-Package: org.knime.python3.scripting 26 | Automatic-Module-Name: org.knime.python3.scripting 27 | Eclipse-BundleShape: dir 28 | Eclipse-RegisterBuddy: org.knime.ext.py4j 29 | -------------------------------------------------------------------------------- /org.knime.python3.scripting/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | knime-python3-scripting.jar,\ 3 | LICENSE.TXT,\ 4 | CHANGELOG.md,\ 5 | plugin.xml,\ 6 | src/main/python/ 7 | src.includes = LICENSE.TXT 8 | src.excludes = src/main/python/ 9 | source.knime-python3-scripting.jar = src/main/java/ 10 | output.knime-python3-scripting.jar = target/classes/ 11 | bin.excludes = maven.properties 12 | pom.model.property.sonar.sources=src/ -------------------------------------------------------------------------------- /org.knime.python3.scripting/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /org.knime.python3.testing/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.knime.python3.testing/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.testing 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.knime.python3.testing/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.python3.testing/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.testing 8 | -------------------------------------------------------------------------------- /org.knime.python3.testing/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Testing Utilities for org.knime.python3 4 | Bundle-SymbolicName: org.knime.python3.testing;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Require-Bundle: org.apache.commons.lang3;bundle-version="[3.9.0,4.0.0)", 10 | org.knime.python3;bundle-version="[5.5.0,6.0.0)", 11 | org.knime.core.columnar;bundle-version="[5.5.0,6.0.0)" 12 | Automatic-Module-Name: org.knime.python3.testing 13 | Export-Package: org.knime.python3.testing 14 | -------------------------------------------------------------------------------- /org.knime.python3.testing/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | LICENSE.TXT 4 | src.includes = LICENSE.TXT 5 | source.. = src/main/java/ 6 | output.. = target/classes/ 7 | -------------------------------------------------------------------------------- /org.knime.python3.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.knime.python3.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.knime.python3.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.knime.python3.tests/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.tests 8 | -------------------------------------------------------------------------------- /org.knime.python3.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Unit Tests for org.knime.python3 4 | Bundle-SymbolicName: org.knime.python3.tests;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Fragment-Host: org.knime.python3;bundle-version="[5.5.0,6.0.0)" 10 | Require-Bundle: org.junit;bundle-version="[4.13.0,5.0.0)", 11 | org.knime.python3.testing;bundle-version="[5.5.0,6.0.0)" 12 | Automatic-Module-Name: org.knime.python3.tests 13 | Export-Package: org.knime.python3 14 | -------------------------------------------------------------------------------- /org.knime.python3.tests/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | .,\ 3 | LICENSE.TXT,\ 4 | src/test/python/ 5 | src.includes = LICENSE.TXT 6 | src.excludes = src/test/python/ 7 | source.. = src/test/java/ 8 | output.. = target/classes/ 9 | -------------------------------------------------------------------------------- /org.knime.python3.tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.knime 5 | knime-python 6 | ${revision}${changelist} 7 | 8 | org.knime.python3.tests 9 | eclipse-test-plugin 10 | 11 | 12 | 5.5.0 13 | 14 | src 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.tycho 21 | target-platform-configuration 22 | ${tycho.version} 23 | 24 | 25 | 26 | 27 | eclipse-feature 28 | org.knime.features.clfixes 29 | 0.0.0 30 | 31 | 32 | eclipse-feature 33 | org.knime.features.python3.nodes 34 | 0.0.0 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.eclipse.tycho 42 | tycho-surefire-plugin 43 | ${tycho.version} 44 | 45 | ${failsafeArgLine} ${knime.tycho.test.configuration} 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /org.knime.python3.tests/src/test/python/broken_extension.py: -------------------------------------------------------------------------------- 1 | """ 2 | This extension is broken. 3 | """ 4 | 5 | raise ValueError("very " * 1000 + "long error message") 6 | -------------------------------------------------------------------------------- /org.knime.python3.tests/src/test/python/broken_launcher.py: -------------------------------------------------------------------------------- 1 | import knime._backend._gateway as kg 2 | 3 | 4 | class DummyEntryPoint(kg.EntryPoint): 5 | class Java: 6 | implements = ["org.knime.python3.DefaultPythonGatewayTest.DummyEntryPoint"] 7 | 8 | 9 | # this was the mistake I got stuck with 10 | print(any(["foo"], lambda x: x == "foo")) 11 | 12 | kg.connect_to_knime(DummyEntryPoint()) 13 | -------------------------------------------------------------------------------- /org.knime.python3.tests/src/test/python/chatty_launcher.py: -------------------------------------------------------------------------------- 1 | import knime._backend._gateway as kg 2 | 3 | for _ in range(1000): 4 | print("something") 5 | 6 | print("done chatting") 7 | 8 | 9 | class DummyEntryPoint(kg.EntryPoint): 10 | class Java: 11 | implements = ["org.knime.python3.DefaultPythonGatewayTest.DummyEntryPoint"] 12 | 13 | 14 | kg.connect_to_knime(DummyEntryPoint()) 15 | -------------------------------------------------------------------------------- /org.knime.python3.tests/src/test/python/dummy_launcher.py: -------------------------------------------------------------------------------- 1 | import knime._backend._gateway as kg 2 | 3 | 4 | class DummyEntryPoint(kg.EntryPoint): 5 | class Java: 6 | implements = ["org.knime.python3.DefaultPythonGatewayTest.DummyEntryPoint"] 7 | 8 | 9 | kg.connect_to_knime(DummyEntryPoint()) 10 | -------------------------------------------------------------------------------- /org.knime.python3.tests/src/test/python/printing_launcher.py: -------------------------------------------------------------------------------- 1 | import knime._backend._gateway as kg 2 | 3 | print("startup") 4 | 5 | 6 | class PrintingEntryPoint(kg.EntryPoint): 7 | def print(self, msg): 8 | print(msg) 9 | 10 | class Java: 11 | implements = ["org.knime.python3.DefaultPythonGatewayTest.PrintingEntryPoint"] 12 | 13 | 14 | kg.connect_to_knime(PrintingEntryPoint()) 15 | -------------------------------------------------------------------------------- /org.knime.python3.views.tests/src/main/python/.gitignore: -------------------------------------------------------------------------------- 1 | *.html -------------------------------------------------------------------------------- /org.knime.python3.views.tests/src/main/python/unittest/small.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/org.knime.python3.views.tests/src/main/python/unittest/small.jpeg -------------------------------------------------------------------------------- /org.knime.python3.views.tests/src/main/python/unittest/small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knime/knime-python/26708f5c85fa3ad7cda942c2dd5547f582dc531d/org.knime.python3.views.tests/src/main/python/unittest/small.png -------------------------------------------------------------------------------- /org.knime.python3.views/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.knime.python3.views/.gitignore: -------------------------------------------------------------------------------- 1 | src/main/python/knime/api/knime-ui-extension-service*.js 2 | -------------------------------------------------------------------------------- /org.knime.python3.views/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3.views 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.ManifestBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.SchemaBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.jdt.core.javanature 32 | org.eclipse.pde.PluginNature 33 | 34 | 35 | 36 | 1618234189428 37 | 38 | 30 39 | 40 | org.eclipse.core.resources.regexFilterMatcher 41 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /org.knime.python3.views/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//py/DBUtil.py=utf-8 3 | encoding//py/DataTables.py=utf-8 4 | encoding//py/EnvironmentHelper.py=utf-8 5 | encoding//py/JupyterSupport.py=utf-8 6 | encoding//py/PythonCommands.py=utf-8 7 | encoding//py/PythonKernelBase.py=utf-8 8 | encoding//py/PythonKernelLauncher.py=utf-8 9 | encoding//py/PythonKernelTester.py=utf-8 10 | encoding//py/PythonUtils.py=utf-8 11 | encoding//py/ReadWriteLock.py=utf-8 12 | encoding//py/Serializer.py=utf-8 13 | encoding//py/TypeExtensionManager.py=utf-8 14 | encoding//py/debug_util.py=utf-8 15 | encoding//py/jaydebeapi.py=utf-8 16 | encoding//py/messaging/AbstractTaskHandler.py=utf-8 17 | encoding//py/messaging/Message.py=utf-8 18 | encoding//py/messaging/MessageDistributor.py=utf-8 19 | encoding//py/messaging/MessageReceiver.py=utf-8 20 | encoding//py/messaging/MessageSender.py=utf-8 21 | encoding//py/messaging/PythonMessagingBase.py=utf-8 22 | encoding//py/messaging/RequestHandlers.py=utf-8 23 | encoding//py/messaging/Task.py=utf-8 24 | encoding//py/python2/PythonKernel.py=utf-8 25 | encoding//py/python2/SynchronousExecutor.py=utf-8 26 | encoding//py/python2/messaging/PythonMessaging.py=utf-8 27 | encoding//py/python3/PythonKernel.py=utf-8 28 | encoding//py/python3/_ExecutionMonitor.py=utf-8 29 | encoding//py/python3/_QueuedExecutor.py=utf-8 30 | encoding//py/python3/messaging/AbstractMessageLoop.py=utf-8 31 | encoding//py/python3/messaging/MessageDistributorLoop.py=utf-8 32 | encoding//py/python3/messaging/MessageReceiverLoop.py=utf-8 33 | encoding//py/python3/messaging/PythonMessaging.py=utf-8 34 | encoding//py/python3/messaging/testing/MessagingTest.py=utf-8 35 | encoding/=UTF-8 36 | -------------------------------------------------------------------------------- /org.knime.python3.views/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3.views 8 | -------------------------------------------------------------------------------- /org.knime.python3.views/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: KNIME Python - Views 4 | Bundle-SymbolicName: org.knime.python3.views;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: knime-python3-views.jar 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Bundle-ActivationPolicy: lazy 10 | Require-Bundle: org.knime.python3;bundle-version="[5.5.0,6.0.0)", 11 | org.knime.core;bundle-version="[5.5.0,6.0.0)", 12 | org.knime.core.ui;bundle-version="[5.5.0,6.0.0)", 13 | com.fasterxml.jackson.core.jackson-databind;bundle-version="[2.16.1,3.0.0)", 14 | com.fasterxml.jackson.core.jackson-core;bundle-version="[2.16.1,3.0.0)" 15 | Automatic-Module-Name: org.knime.python3.views 16 | Eclipse-BundleShape: dir 17 | Eclipse-RegisterBuddy: org.knime.ext.py4j 18 | Export-Package: org.knime.python3.views 19 | -------------------------------------------------------------------------------- /org.knime.python3.views/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = knime-python3-views.jar,\ 2 | META-INF/,\ 3 | LICENSE.TXT,\ 4 | CHANGELOG.md,\ 5 | src/main/python/ 6 | src.includes = LICENSE.TXT,\ 7 | src/ 8 | source.knime-python3-views.jar = src/main/java/ 9 | output.knime-python3-views.jar = target/classes/ 10 | -------------------------------------------------------------------------------- /org.knime.python3.views/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Download knime-ui-extension-service JS build from npm. 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 17 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /org.knime.python3.views/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.knime 5 | knime-python 6 | ${revision}${changelist} 7 | ../pom.xml 8 | 9 | org.knime.python3.views 10 | ${packaging.default} 11 | 12 | 13 | 5.5.0 14 | src 15 | 16 | 17 | 18 | 19 | 20 | org.apache.maven.plugins 21 | maven-antrun-plugin 22 | 3.1.0 23 | 24 | 25 | download knime-ui-extension-service 26 | generate-sources 27 | 28 | run 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /org.knime.python3.views/src/main/python/knime_views.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ------------------------------------------------------------------------ 3 | # Copyright by KNIME AG, Zurich, Switzerland 4 | # Website: http://www.knime.com; Email: contact@knime.com 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License, Version 3, as 8 | # published by the Free Software Foundation. 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, see . 17 | # 18 | # Additional permission under GNU GPL version 3 section 7: 19 | # 20 | # KNIME interoperates with ECLIPSE solely via ECLIPSE's plug-in APIs. 21 | # Hence, KNIME and ECLIPSE are both independent programs and are not 22 | # derived from each other. Should, however, the interpretation of the 23 | # GNU GPL Version 3 ("License") under any applicable laws result in 24 | # KNIME and ECLIPSE being a combined program, KNIME AG herewith grants 25 | # you the additional permission to use and propagate KNIME together with 26 | # ECLIPSE with only the license terms in place for ECLIPSE applying to 27 | # ECLIPSE and the GNU GPL Version 3 applying for KNIME, provided the 28 | # license terms of ECLIPSE themselves allow for the respective use and 29 | # propagation of ECLIPSE together with KNIME. 30 | # 31 | # Additional permission relating to nodes for KNIME that extend the Node 32 | # Extension (and in particular that are based on subclasses of NodeModel, 33 | # NodeDialog, and NodeView) and that only interoperate with KNIME through 34 | # standard APIs ("Nodes"): 35 | # Nodes are deemed to be separate and independent programs and to not be 36 | # covered works. Notwithstanding anything to the contrary in the 37 | # License, the License does not apply to Nodes, you are not required to 38 | # license Nodes under the License, and you are granted a license to 39 | # prepare and propagate Nodes, in each case even if such Nodes are 40 | # propagated with or for interoperation with KNIME. The owner of a Node 41 | # may freely choose the license terms applicable to such Node, including 42 | # when such Node is propagated with or for interoperation with KNIME. 43 | # ------------------------------------------------------------------------ 44 | """ 45 | Old-style import for the modern KNIME Python views interface. 46 | 47 | This only includes the contents of knime.api.views, by which it has been 48 | replaced. 49 | """ 50 | 51 | from knime.api.views import * 52 | 53 | 54 | import warnings 55 | 56 | warnings.warn( 57 | f"The module {__name__} is deprecated, please use 'import knime.api.views' instead", 58 | DeprecationWarning, 59 | stacklevel=2, 60 | ) 61 | -------------------------------------------------------------------------------- /org.knime.python3/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.knime.python3/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.python3 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.ManifestBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.SchemaBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.jdt.core.javanature 32 | org.eclipse.pde.PluginNature 33 | 34 | 35 | 36 | 1618234189428 37 | 38 | 30 39 | 40 | org.eclipse.core.resources.regexFilterMatcher 41 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /org.knime.python3/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//py/DBUtil.py=utf-8 3 | encoding//py/DataTables.py=utf-8 4 | encoding//py/EnvironmentHelper.py=utf-8 5 | encoding//py/JupyterSupport.py=utf-8 6 | encoding//py/PythonCommands.py=utf-8 7 | encoding//py/PythonKernelBase.py=utf-8 8 | encoding//py/PythonKernelLauncher.py=utf-8 9 | encoding//py/PythonKernelTester.py=utf-8 10 | encoding//py/PythonUtils.py=utf-8 11 | encoding//py/ReadWriteLock.py=utf-8 12 | encoding//py/Serializer.py=utf-8 13 | encoding//py/TypeExtensionManager.py=utf-8 14 | encoding//py/debug_util.py=utf-8 15 | encoding//py/jaydebeapi.py=utf-8 16 | encoding//py/messaging/AbstractTaskHandler.py=utf-8 17 | encoding//py/messaging/Message.py=utf-8 18 | encoding//py/messaging/MessageDistributor.py=utf-8 19 | encoding//py/messaging/MessageReceiver.py=utf-8 20 | encoding//py/messaging/MessageSender.py=utf-8 21 | encoding//py/messaging/PythonMessagingBase.py=utf-8 22 | encoding//py/messaging/RequestHandlers.py=utf-8 23 | encoding//py/messaging/Task.py=utf-8 24 | encoding//py/python2/PythonKernel.py=utf-8 25 | encoding//py/python2/SynchronousExecutor.py=utf-8 26 | encoding//py/python2/messaging/PythonMessaging.py=utf-8 27 | encoding//py/python3/PythonKernel.py=utf-8 28 | encoding//py/python3/_ExecutionMonitor.py=utf-8 29 | encoding//py/python3/_QueuedExecutor.py=utf-8 30 | encoding//py/python3/messaging/AbstractMessageLoop.py=utf-8 31 | encoding//py/python3/messaging/MessageDistributorLoop.py=utf-8 32 | encoding//py/python3/messaging/MessageReceiverLoop.py=utf-8 33 | encoding//py/python3/messaging/PythonMessaging.py=utf-8 34 | encoding//py/python3/messaging/testing/MessagingTest.py=utf-8 35 | encoding/=UTF-8 36 | -------------------------------------------------------------------------------- /org.knime.python3/.settings/org.sonarlint.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | autoEnabled=true 2 | bindingSuggestionsDisabled=false 3 | eclipse.preferences.version=1 4 | idePrefixKey= 5 | projectKey=KNIME_knime-python 6 | serverId=SonarCloud 7 | sqPrefixKey=org.knime.python3 8 | -------------------------------------------------------------------------------- /org.knime.python3/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: KNIME Python 3 4 | Bundle-SymbolicName: org.knime.python3;singleton:=true 5 | Bundle-Version: 5.5.0.qualifier 6 | Bundle-ClassPath: knime-python3.jar 7 | Bundle-Vendor: KNIME AG, Zurich, Switzerland 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Bundle-ActivationPolicy: lazy 10 | Require-Bundle: com.google.guava;bundle-version="[31.0.1,32.0.0)", 11 | org.apache.commons.lang3;bundle-version="[3.9.0,4.0.0)", 12 | org.knime.core;bundle-version="[5.5.0,6.0.0)", 13 | org.knime.core.table;bundle-version="[5.5.0,6.0.0)", 14 | com.fasterxml.jackson.core.jackson-databind;bundle-version="[2.12.1,3.0.0)", 15 | org.knime.ext.py4j;bundle-version="[0.10.9.2,0.11.0)", 16 | org.knime.conda;bundle-version="[5.5.0,6.0.0)", 17 | org.knime.python3.types;bundle-version="[5.5.0,6.0.0)", 18 | org.eclipse.equinox.p2.core;bundle-version="[2.0.0,3.0.0)";visibility:=reexport, 19 | org.eclipse.equinox.p2.engine;bundle-version="[2.0.0,3.0.0)";visibility:=reexport 20 | Export-Package: org.knime.python3, 21 | org.knime.python3.utils 22 | Automatic-Module-Name: org.knime.python3 23 | Eclipse-RegisterBuddy: org.knime.ext.py4j 24 | Eclipse-BundleShape: dir 25 | Bundle-Activator: org.knime.python3.Activator 26 | -------------------------------------------------------------------------------- /org.knime.python3/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | knime-python3.jar,\ 3 | LICENSE.TXT,\ 4 | CHANGELOG.md,\ 5 | src/main/python/ 6 | src.includes = LICENSE.TXT 7 | src.excludes = src/main/python/ 8 | source.knime-python3.jar = src/main/java/ 9 | output.knime-python3.jar = target/classes/ 10 | bin.excludes = maven.properties 11 | pom.model.property.sonar.sources=src/ -------------------------------------------------------------------------------- /org.knime.python3/src/main/python/knime/_backend/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module is not intended to be used or referenced by clients. 3 | """ 4 | -------------------------------------------------------------------------------- /org.knime.update.python/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.knime.update.python 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.m2e.core.maven2Builder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Nature 16 | 17 | 18 | 19 | 1667292967908 20 | 21 | 30 22 | 23 | org.eclipse.core.resources.regexFilterMatcher 24 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.knime.update.python/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /org.knime.update.python/category.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Build artifacts from knime-python 9 | id ~= /.+/ 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.knime.update.python/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.knime 7 | knime-python 8 | ${revision}${changelist} 9 | ../pom.xml 10 | 11 | 12 | org.knime.update.python 13 | eclipse-repository 14 | 15 | 16 | 5.5.0 17 | 18 | 19 | -------------------------------------------------------------------------------- /pytest-envs/README.md: -------------------------------------------------------------------------------- 1 | # Pytest Tests 2 | 3 | The Python Unit tests run with `pytest` on a bunch of different environments. 4 | They are quick and cheap to run so adding new environments provides quick 5 | feedback of potential issues in different environments. 6 | -------------------------------------------------------------------------------- /pytest-envs/env_py311.yml: -------------------------------------------------------------------------------- 1 | name: python_test_environment 2 | channels: 3 | - conda-forge 4 | - knime 5 | dependencies: 6 | - python=3.11 7 | - knime-python-base=5.2 8 | - coverage 9 | - pytest 10 | - matplotlib # View tests 11 | - seaborn # View tests 12 | -------------------------------------------------------------------------------- /pytest-envs/env_py38.yml: -------------------------------------------------------------------------------- 1 | name: python_test_environment 2 | channels: 3 | - conda-forge 4 | - knime 5 | dependencies: 6 | - python=3.8 7 | - knime-python-base=4.7 8 | - pytest 9 | - coverage 10 | - matplotlib # View tests 11 | - seaborn # View tests 12 | -------------------------------------------------------------------------------- /pytest-envs/env_py38_legacy.yml: -------------------------------------------------------------------------------- 1 | name: python_test_environment 2 | channels: 3 | - conda-forge 4 | - knime 5 | dependencies: 6 | - python=3.8 7 | - pytest 8 | - coverage 9 | - pyarrow=6.0 10 | - numpy=1.19 11 | - pandas=1.3 12 | - py4j=0.10.9 13 | - markdown=3.3 14 | - matplotlib # View tests 15 | - seaborn # View tests 16 | -------------------------------------------------------------------------------- /pytest-envs/env_py39.yml: -------------------------------------------------------------------------------- 1 | name: python_test_environment 2 | channels: 3 | - conda-forge 4 | - knime 5 | dependencies: 6 | - python=3.9 7 | - knime-python-base=4.7 8 | - coverage 9 | - pytest 10 | - matplotlib # View tests 11 | - seaborn # View tests 12 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | # Ignore all classes that are not a unittest.TestCase 3 | python_classes = 4 | -------------------------------------------------------------------------------- /ruff.toml: -------------------------------------------------------------------------------- 1 | target-version = "py38" 2 | -------------------------------------------------------------------------------- /workflow-tests/README.md: -------------------------------------------------------------------------------- 1 | # Workflow Tests 2 | 3 | The workflow tests are integration tests. They will run on all supported OSes 4 | with different environments. Instead of testing many different combinations of 5 | Python packages we test a few combinations. To test backward compatibility we 6 | keep environments with old versions of packages. On `releases/` branches we run 7 | the workflow tests with all environment definitions. On the master branch, we 8 | only run the workflow test with the latest environment definition. 9 | -------------------------------------------------------------------------------- /workflow-tests/env_py36_pa5.yml: -------------------------------------------------------------------------------- 1 | name: python_test_environment 2 | channels: 3 | - conda-forge 4 | - knime 5 | dependencies: 6 | - python=3.6 7 | - pyarrow=5 8 | - pandas=1.1 9 | - py4j=0.10 10 | - nbformat # Jupyter nodebook loading 11 | - ipython # Jupyter nodebook loading 12 | - matplotlib # Used in default script 13 | -------------------------------------------------------------------------------- /workflow-tests/env_py38_pa7.yml: -------------------------------------------------------------------------------- 1 | name: python_test_environment 2 | channels: 3 | - conda-forge 4 | - knime 5 | dependencies: 6 | - python=3.8 7 | - pyarrow=7 8 | - pandas=1.3 9 | - py4j=0.10 10 | - nbformat # Jupyter nodebook loading 11 | - ipython # Jupyter nodebook loading 12 | - matplotlib # Used in default script 13 | -------------------------------------------------------------------------------- /workflow-tests/env_py39_kn47.yml: -------------------------------------------------------------------------------- 1 | name: python_test_environment 2 | channels: 3 | - conda-forge 4 | - knime 5 | dependencies: 6 | - python=3.9 7 | - knime-python-base=4.7 8 | - nbformat # Jupyter nodebook loading 9 | - ipython # Jupyter nodebook loading 10 | - matplotlib # Used in default script 11 | -------------------------------------------------------------------------------- /workflow-tests/preferences-Linux.epf: -------------------------------------------------------------------------------- 1 | @org.knime.workbench.core=2.10.0.0043156 2 | \!/= 3 | file_export_version=3.0 4 | /instance/org.knime.python2/pythonEnvironmentType=conda 5 | /instance/org.knime.python2/condaDirectoryPath=/home/jenkins/miniconda3 6 | /instance/org.knime.python2/python3CondaEnvironmentDirectoryPath= 7 | /instance/org.knime.core.data.columnar/knime.core.data.columnar.off-heap-limit=1024 8 | -------------------------------------------------------------------------------- /workflow-tests/preferences-MacOSX.epf: -------------------------------------------------------------------------------- 1 | @org.knime.workbench.core=2.10.0.0043156 2 | \!/= 3 | file_export_version=3.0 4 | /instance/org.knime.python2/pythonEnvironmentType=conda 5 | /instance/org.knime.python2/condaDirectoryPath=/Users/jenkins/miniconda3 6 | /instance/org.knime.python2/python3CondaEnvironmentDirectoryPath= 7 | /instance/org.knime.core.data.columnar/knime.core.data.columnar.off-heap-limit=1024 8 | -------------------------------------------------------------------------------- /workflow-tests/preferences-Windows.epf: -------------------------------------------------------------------------------- 1 | @org.knime.workbench.core=2.10.0.0043156 2 | \!/= 3 | file_export_version=3.0 4 | /instance/org.knime.python2/pythonEnvironmentType=conda 5 | /instance/org.knime.python2/condaDirectoryPath=C:\\Users\\jenkins\\Miniconda3 6 | /instance/org.knime.python2/python3CondaEnvironmentDirectoryPath= 7 | /instance/org.knime.core.data.columnar/knime.core.data.columnar.off-heap-limit=1024 8 | -------------------------------------------------------------------------------- /workflow-tests/setup-Linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create the Python environment if required 4 | if [[ -n $KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT ]]; then 5 | prefPath="${WORKSPACE}/workflow-tests/preferences-Linux.epf" 6 | 7 | if [[ $KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT = "bundled" ]]; then 8 | envPath="${WORKSPACE}/knime test.app/bundling/envs/org_knime_pythonscripting" 9 | echo "Using bundled environment at ${envPath}" 10 | else 11 | envPath="${WORKSPACE}/python_test_environment" 12 | echo "Creating Conda environment for: ${KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT} at ${envPath}" 13 | 14 | micromamba create \ 15 | -p ${envPath} \ 16 | -f ${WORKSPACE}/workflow-tests/${KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT} 17 | micromamba list -p ${envPath} 18 | fi 19 | 20 | sedi "s||${envPath}|g" "${prefPath}" 21 | cat "${prefPath}" 22 | fi -------------------------------------------------------------------------------- /workflow-tests/setup-MacOSX.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create the Python environment if required 4 | if [[ -n $KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT ]]; then 5 | prefPath="${WORKSPACE}/workflow-tests/preferences-MacOSX.epf" 6 | 7 | if [[ $KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT = "bundled" ]]; then 8 | envPath="${WORKSPACE}/knime test.app/Contents/Eclipse/bundling/envs/org_knime_pythonscripting" 9 | echo "Using bundled environment at ${envPath}" 10 | else 11 | envPath="${WORKSPACE}/python_test_environment" 12 | echo "Creating Conda environment for: ${KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT} at ${envPath}" 13 | 14 | micromamba create \ 15 | -r ${WORKSPACE}/micromamba-root \ 16 | -p ${envPath} \ 17 | -f ${WORKSPACE}/workflow-tests/${KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT} 18 | micromamba list -p ${envPath} 19 | fi 20 | 21 | sedi "s||${envPath}|g" "${prefPath}" 22 | cat "${prefPath}" 23 | fi 24 | -------------------------------------------------------------------------------- /workflow-tests/setup-Windows.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create the Python environment if required 4 | if [[ -n $KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT ]]; then 5 | prefPath="${WORKSPACE}/workflow-tests/preferences-Windows.epf" 6 | 7 | if [[ $KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT = "bundled" ]]; then 8 | envPath="${WORKSPACE}\\\\knime test.app\\\\bundling\\\\envs\\\\org_knime_pythonscripting" 9 | echo "Using bundled environment at ${envPath}" 10 | else 11 | envPath="${WORKSPACE}\\\\python_test_environment" 12 | echo "Creating Conda environment for: ${KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT} at ${envPath}" 13 | 14 | cmd /c C:/tools/micromamba.exe create \ 15 | -p ${envPath} \ 16 | -f ${WORKSPACE}\\workflow-tests\\${KNIME_WORKFLOWTEST_PYTHON_ENVIRONMENT} 17 | cmd /c C:/tools/micromamba.exe list -p ${envPath} 18 | fi 19 | 20 | sedi "s||${envPath//\\/\\\\\\\\}|g" "${prefPath}" 21 | cat "${prefPath}" 22 | fi 23 | -------------------------------------------------------------------------------- /workflow-tests/vmargs: -------------------------------------------------------------------------------- 1 | -Dknime.python.connecttimeout=60000 2 | --------------------------------------------------------------------------------