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:36:00 UTC

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

Valentyn Tymofieiev created BEAM-8482:
-----------------------------------------

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


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