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

Danny McCormick commented on BEAM-8482:
---------------------------------------

This issue has been migrated to https://github.com/apache/beam/issues/19848

> Beam transforms declared inside a method fail to pickle.
> --------------------------------------------------------
>
>                 Key: BEAM-8482
>                 URL: https://issues.apache.org/jira/browse/BEAM-8482
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Valentyn Tymofieiev
>            Priority: P3
>
> {noformat}
> from apache_beam.internal import pickler                                      
>                                                                               
>                                                                               
>                                                                               
>                                                                               
>                                    
>                                                                               
>      
> class Outter():                                                               
>      
>   def method(self):                                                           
>      
>     class InnerA(object):                                                     
>      
>       def __init__(self):                                                     
>      
>         pass                                                                  
>      
>                                                                               
>      
>     class InnerB(InnerA):                                                     
>      
>       def __init__(self):                                                     
>      
>         super(InnerB, self).__init__()                                        
>      
>                                                                               
>      
>     o = InnerB()                                                              
>      
>     pickler.loads(pickler.dumps(o))                                           
>      
>                                                                               
>      
> c = Outter()                                                                  
>      
> c.method()  
> {noformat}
> fails with
> {noformat}
> RuntimeError: maximum recursion depth exceeded while getting the str of an 
> object
> {noformat}
> Workaround: declare the transforms on the module level. 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to