You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Valentyn Tymofieiev (Jira)" <ji...@apache.org> on 2019/10/25 00:40:00 UTC

[jira] [Commented] (BEAM-8482) Beam transforms declared inside a method fail to pickle.

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

Valentyn Tymofieiev commented on BEAM-8482:
-------------------------------------------

See also: https://issues.apache.org/jira/browse/BEAM-8397?focusedCommentId=16958414&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16958414 


> 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: Major
>
> {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.3.4#803005)