szaszm commented on code in PR #1930:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1930#discussion_r2150213419


##########
extensions/python/ExecutePythonProcessor.cpp:
##########
@@ -58,6 +54,17 @@ void ExecutePythonProcessor::initialize() {
   initalizeThroughScriptEngine();
 }
 
+void ExecutePythonProcessor::initialize() {
+  initializeScript();
+  std::vector<core::PropertyReference> all_properties{Properties.begin(), 
Properties.end()};
+  for (auto& python_prop : python_properties_) {
+    all_properties.push_back(python_prop.getReference());
+  }

Review Comment:
   ```suggestion
     ranges::transform(python_properties_, std::back_inserter(all_properties), 
&core::Property::getReference);
   ```



##########
extensions/python/ExecutePythonProcessor.cpp:
##########
@@ -125,22 +134,18 @@ void ExecutePythonProcessor::loadScriptFromFile() {
 }
 
 void ExecutePythonProcessor::loadScript() {
-  std::string script_file = getProperty(ScriptFile.name).value_or("");
-  std::string script_body = getProperty(ScriptBody.name).value_or("");
-  if (script_file.empty() && script_body.empty()) {
+  if (script_file_path_.empty() && script_to_exec_.empty()) {
     throw std::runtime_error("Neither Script Body nor Script File is available 
to execute");
   }
 
-  if (!script_file.empty()) {
-    if (!script_body.empty()) {
+  if (!script_file_path_.empty()) {
+    if (!script_to_exec_.empty()) {

Review Comment:
   line 147 (return statement) can be removed now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to