lordgamez commented on code in PR #1863:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1863#discussion_r1775067158


##########
extensions/python/types/PyProcessSession.cpp:
##########
@@ -178,14 +178,24 @@ PyObject* 
PyProcessSessionObject::get(PyProcessSessionObject* self, PyObject*) {
   return object::returnReference(nullptr);
 }
 
-PyObject* PyProcessSessionObject::create(PyProcessSessionObject* self, 
PyObject*) {
+PyObject* PyProcessSessionObject::create(PyProcessSessionObject* self, 
PyObject* args) {
   auto session = self->process_session_.lock();
   if (!session) {
     PyErr_SetString(PyExc_AttributeError, "tried reading process session 
outside 'on_trigger'");
     return nullptr;
   }
 
-  if (auto flow_file = session->create(nullptr))
+  std::shared_ptr<core::FlowFile> parent_flow_file;
+  auto arg_size = PyTuple_Size(args);
+  if (arg_size > 0) {
+    PyObject* script_flow_file = nullptr;
+    if (!PyArg_ParseTuple(args, "O!", PyScriptFlowFile::typeObject(), 
&script_flow_file)) {
+      return nullptr;
+    }

Review Comment:
   When we define a method using the python C API, if the return value is 
nullptr it signals the python C API that an error has occurred and it actually 
results in an exception on the python side, so it should already result in an 
exception.



-- 
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