[ 
https://issues.apache.org/jira/browse/BEAM-4752?focusedWorklogId=122917&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-122917
 ]

ASF GitHub Bot logged work on BEAM-4752:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jul/18 15:52
            Start Date: 13/Jul/18 15:52
    Worklog Time Spent: 10m 
      Work Description: aaltay closed pull request #5931: [BEAM-4752] Add 
support for newer dill dependency
URL: https://github.com/apache/beam/pull/5931
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sdks/python/apache_beam/internal/pickler.py 
b/sdks/python/apache_beam/internal/pickler.py
index 3a04d8c36bf..a4d20b9d043 100644
--- a/sdks/python/apache_beam/internal/pickler.py
+++ b/sdks/python/apache_beam/internal/pickler.py
@@ -39,6 +39,12 @@
 
 import dill
 
+# Dill 0.28.0 renamed dill.dill to dill._dill:
+# 
https://github.com/uqfoundation/dill/commit/f0972ecc7a41d0b8acada6042d557068cac69baa
+# TODO: Remove this once Beam depends on dill >= 0.2.8
+if not getattr(dill, 'dill', None):
+  dill.dill = dill._dill
+
 
 def _is_nested_class(cls):
   """Returns true if argument is a class object that appears to be nested."""
diff --git a/sdks/python/setup.py b/sdks/python/setup.py
index 110228a994c..46c80500a17 100644
--- a/sdks/python/setup.py
+++ b/sdks/python/setup.py
@@ -97,7 +97,7 @@ def get_version():
 REQUIRED_PACKAGES = [
     'avro>=1.8.1,<2.0.0',
     'crcmod>=1.7,<2.0',
-    'dill==0.2.6',
+    'dill>=0.2.6,<=0.2.8.2',
     'grpcio>=1.8,<2',
     'hdfs>=2.1.0,<3.0.0',
     'httplib2>=0.8,<=0.11.3',


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 122917)
    Time Spent: 50m  (was: 40m)

> Import error in apache_beam.internal.pickler: "'module' object has no 
> attribute 'dill'"
> ---------------------------------------------------------------------------------------
>
>                 Key: BEAM-4752
>                 URL: https://issues.apache.org/jira/browse/BEAM-4752
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>    Affects Versions: 2.4.0
>         Environment: CentOS Linux release 7.4.1708
> Python 2.7.13
>            Reporter: Barry Hart
>            Assignee: Ahmet Altay
>            Priority: Major
>             Fix For: 2.4.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> I'm seeing the following error (stack trace below). I looked at the module 
> structure of the {{dill}} library, and it does not have a {{dill}} submodule 
> (although it *does* have a {{_dill}} submodule). I think the correct way to 
> reference {{Pickler}} is simply {{dill.Pickler.}}
> {noformat}
> Traceback (most recent call last):
>   File "script/beam_run_model.py", line 29, in <module>
>     import apache_beam as beam
>   File 
> "/usr/local/pyenv/versions/2.7.13/lib/python2.7/site-packages/apache_beam/__init__.py",
>  line 84, in <module>
>     import apache_beam.internal.pickler
>   File 
> "/usr/local/pyenv/versions/2.7.13/lib/python2.7/site-packages/apache_beam/internal/pickler.py",
>  line 107, in <module>
>     dill.dill.Pickler.dispatch[type])
> AttributeError: 'module' object has no attribute 'dill'{noformat}
> Oddly, I have successfully used Beam 2.4.0 in the past with this version of 
> Dill.  ¯_(ツ)_/¯



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to