[ 
https://issues.apache.org/jira/browse/NIFI-12675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17813372#comment-17813372
 ] 

ASF subversion and git services commented on NIFI-12675:
--------------------------------------------------------

Commit a587bad71169fef91dbd2d1302a26f43e6efc182 in nifi's branch 
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=a587bad711 ]

NIFI-12675 Fixed custom Relationships with Python Processors

Fixed bug that caused custom Relationships not to work on Python Processors. 
Added unit test to verify. Also addressed issue in 
PythonControllerInteractionIT where it did not wait for Processors to become 
valid (originally this wasn't necessary but when we refactored Processors to 
initialize in the background this was overlooked).

This closes #8316

Signed-off-by: David Handermann <exceptionfact...@apache.org>


> Python Processor erroring when creating custom relationships
> ------------------------------------------------------------
>
>                 Key: NIFI-12675
>                 URL: https://issues.apache.org/jira/browse/NIFI-12675
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> From apache Slack thread 
> ([https://apachenifi.slack.com/archives/C0L9VCD47/p1706176890922519):]
> {quote}Hello, I am trying to test some custom python processors with nifi 
> 2.0.0-M1
> It works fine except when I try to add custom relationships to it (other than 
> the default success, failure and original).
> Here's what I am trying:
> {code:java}
>         self.matched = Relationship("matched", "flowfiles having a match with 
> the regex")
>         self.unmatched = Relationship("unmatched", "flowfiles not having any 
> match with regex")
>         self.failure = Relationship("failure", "flowfiles for which process 
> errored while matching")
>         self.relationships = {self.matched, self.unmatched, self.failure}
> {code}
> I get py4j complaining about AttributeError: 'set' object has no attribute 
> '_get_object_id'
> which seems like the auto conversion of Python to java container is not 
> happening for "Relationship" class. Any idea what could be wrong here?
> {quote}
> The problem appears to be that Relationships created are of type 
> {{nifiapi.Relationship}} but that is being sent back to the Java side without 
> being converted into a {{org.apache.nifi.processor.Relationship}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to