prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Import errors when trying to run Chicago Taxi on Dataflow
  Similarly as in issue [#47](https://github.com/tensorflow/tfx/issues/47), I still have a problem with running CTE on Dataflow. When I use the code with no modifications, the error from previous issue persists - it seems that somehow the `try-except` around the imports doesn't do its job.
  
  When I changed the code to include only the relative import in my fork [here](https://github.com/mwalenia/tfx/tree/import-fix), the problem disappeared, but another one manifested.
  
  This time, there's a problem with importing `estimator` from tensorflow somewhere in the dependencies. Stacktrace:
  
  ```Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/dataflow_worker/batchworker.py", line 773, in run
      self._load_main_session(self.local_staging_directory)
    File "/usr/local/lib/python2.7/dist-packages/dataflow_worker/batchworker.py", line 489, in _load_main_session
      pickler.load_session(session_file)
    File "/usr/local/lib/python2.7/dist-packages/apache_beam/internal/pickler.py", line 269, in load_session
      return dill.load_session(file_path)
    File "/usr/local/lib/python2.7/dist-packages/dill/_dill.py", line 410, in load_session
      module = unpickler.load()
    File "/usr/lib/python2.7/pickle.py", line 864, in load
      dispatch[key](self)
    File "/usr/lib/python2.7/pickle.py", line 1139, in load_reduce
      value = func(*args)
    File "/usr/local/lib/python2.7/dist-packages/dill/_dill.py", line 828, in _import_module
      return getattr(__import__(module, None, None, [obj]), obj)
    File "/usr/local/lib/python2.7/dist-packages/trainer/taxi.py", line 19, in <module>
      from tensorflow_transform import coders as tft_coders
    File "/usr/local/lib/python2.7/dist-packages/tensorflow_transform/__init__.py", line 19, in <module>
      from tensorflow_transform.analyzers import *
    File "/usr/local/lib/python2.7/dist-packages/tensorflow_transform/analyzers.py", line 39, in <module>
      from tensorflow_transform import tf_utils
    File "/usr/local/lib/python2.7/dist-packages/tensorflow_transform/tf_utils.py", line 24, in <module>
      from tensorflow.contrib.proto.python.ops import encode_proto_op
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/__init__.py", line 48, in <module>
      from tensorflow.contrib import distribute
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/distribute/__init__.py", line 34, in <module>
      from tensorflow.contrib.distribute.python.tpu_strategy import TPUStrategy
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/distribute/python/tpu_strategy.py", line 27, in <module>
      from tensorflow.contrib.tpu.python.ops import tpu_ops
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/tpu/__init__.py", line 73, in <module>
      from tensorflow.contrib.tpu.python.tpu.keras_support import tpu_model as keras_to_tpu_model
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/tpu/python/tpu/keras_support.py", line 71, in <module>
      from tensorflow.python.estimator import model_fn as model_fn_lib
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/__init__.py", line 25, in <module>
      import tensorflow.python.estimator.estimator_lib
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator_lib.py", line 22, in <module>
      from tensorflow.python.estimator.canned.baseline import BaselineClassifier
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/canned/baseline.py", line 50, in <module>
      from tensorflow.python.estimator import estimator
  ImportError: cannot import name estimator
  ```
  
  Is there anything I can do to fix this? 
  
  </issue>
  <code>
  [start of tfx/examples/chicago_taxi/setup.py]
  1 # Copyright 2019 Google LLC. All Rights Reserved.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     https://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 """Setup dependencies for local and cloud deployment."""
  15 import setuptools
  16 
  17 # LINT.IfChange
  18 TF_VERSION = '1.12.0'
  19 # LINT.ThenChange(train_mlengine.sh, start_model_server_mlengine.sh)
  20 
  21 # LINT.IfChange
  22 BEAM_VERSION = '2.11.0'
  23 # LINT.ThenChange(setup_beam_on_flink.sh)
  24 
  25 if __name__ == '__main__':
  26   setuptools.setup(
  27       name='tfx_chicago_taxi',
  28       version='0.12.0',
  29       packages=setuptools.find_packages(),
  30       install_requires=[
  31           'apache-beam[gcp]==' + BEAM_VERSION,
  32           'jupyter==1.0',
  33           'numpy==1.14.5',
  34           'protobuf==3.6.1',
  35           'tensorflow==' + TF_VERSION,
  36           'tensorflow-data-validation==0.12.0',
  37           'tensorflow-metadata==0.12.1',
  38           'tensorflow-model-analysis==0.12.1',
  39           'tensorflow-serving-api==1.12.0',
  40           'tensorflow-transform==0.12.0',
  41       ],
  42       python_requires='>=2.7,<3')
  43
  [end of tfx/examples/chicago_taxi/setup.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/tfx/examples/chicago_taxi/setup.py b/tfx/examples/chicago_taxi/setup.py
  --- a/tfx/examples/chicago_taxi/setup.py
  +++ b/tfx/examples/chicago_taxi/setup.py
  @@ -15,28 +15,29 @@
   import setuptools
   
   # LINT.IfChange
  -TF_VERSION = '1.12.0'
  +TF_VERSION = '1.13.1'
   # LINT.ThenChange(train_mlengine.sh, start_model_server_mlengine.sh)
   
   # LINT.IfChange
  -BEAM_VERSION = '2.11.0'
  +BEAM_VERSION = '2.12.0'
   # LINT.ThenChange(setup_beam_on_flink.sh)
   
   if __name__ == '__main__':
     setuptools.setup(
         name='tfx_chicago_taxi',
  -      version='0.12.0',
  +      version='0.13.0',
         packages=setuptools.find_packages(),
         install_requires=[
  -          'apache-beam[gcp]==' + BEAM_VERSION,
  -          'jupyter==1.0',
  -          'numpy==1.14.5',
  -          'protobuf==3.6.1',
  -          'tensorflow==' + TF_VERSION,
  -          'tensorflow-data-validation==0.12.0',
  -          'tensorflow-metadata==0.12.1',
  -          'tensorflow-model-analysis==0.12.1',
  -          'tensorflow-serving-api==1.12.0',
  -          'tensorflow-transform==0.12.0',
  +          'apache-beam[gcp]>=' + BEAM_VERSION,
  +          'jupyter>=1.0,<2',
  +          'notebook>=5.7.8,<5.8',
  +          'numpy>=1.14.5,<2',
  +          'protobuf>=3.7.0,<3.8.0',
  +          'tensorflow>=' + TF_VERSION,
  +          'tensorflow-data-validation>=0.13.1,<0.14',
  +          'tensorflow-metadata>=0.13.1,<0.14',
  +          'tensorflow-model-analysis>=0.13.2,<0.14',
  +          'tensorflow-serving-api>=1.13.0,<1.14',
  +          'tensorflow-transform>=0.13.0,<0.14',
         ],
  -      python_requires='>=2.7,<3')
  +      python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,<4',)
  
verification_info: {"golden_diff": "diff --git a/tfx/examples/chicago_taxi/setup.py b/tfx/examples/chicago_taxi/setup.py\n--- a/tfx/examples/chicago_taxi/setup.py\n+++ b/tfx/examples/chicago_taxi/setup.py\n@@ -15,28 +15,29 @@\n import setuptools\n \n # LINT.IfChange\n-TF_VERSION = '1.12.0'\n+TF_VERSION = '1.13.1'\n # LINT.ThenChange(train_mlengine.sh, start_model_server_mlengine.sh)\n \n # LINT.IfChange\n-BEAM_VERSION = '2.11.0'\n+BEAM_VERSION = '2.12.0'\n # LINT.ThenChange(setup_beam_on_flink.sh)\n \n if __name__ == '__main__':\n   setuptools.setup(\n       name='tfx_chicago_taxi',\n-      version='0.12.0',\n+      version='0.13.0',\n       packages=setuptools.find_packages(),\n       install_requires=[\n-          'apache-beam[gcp]==' + BEAM_VERSION,\n-          'jupyter==1.0',\n-          'numpy==1.14.5',\n-          'protobuf==3.6.1',\n-          'tensorflow==' + TF_VERSION,\n-          'tensorflow-data-validation==0.12.0',\n-          'tensorflow-metadata==0.12.1',\n-          'tensorflow-model-analysis==0.12.1',\n-          'tensorflow-serving-api==1.12.0',\n-          'tensorflow-transform==0.12.0',\n+          'apache-beam[gcp]>=' + BEAM_VERSION,\n+          'jupyter>=1.0,<2',\n+          'notebook>=5.7.8,<5.8',\n+          'numpy>=1.14.5,<2',\n+          'protobuf>=3.7.0,<3.8.0',\n+          'tensorflow>=' + TF_VERSION,\n+          'tensorflow-data-validation>=0.13.1,<0.14',\n+          'tensorflow-metadata>=0.13.1,<0.14',\n+          'tensorflow-model-analysis>=0.13.2,<0.14',\n+          'tensorflow-serving-api>=1.13.0,<1.14',\n+          'tensorflow-transform>=0.13.0,<0.14',\n       ],\n-      python_requires='>=2.7,<3')\n+      python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,<4',)\n", "issue": "Import errors when trying to run Chicago Taxi on Dataflow\nSimilarly as in issue [#47](https://github.com/tensorflow/tfx/issues/47), I still have a problem with running CTE on Dataflow. When I use the code with no modifications, the error from previous issue persists - it seems that somehow the `try-except` around the imports doesn't do its job.\r\n\r\nWhen I changed the code to include only the relative import in my fork [here](https://github.com/mwalenia/tfx/tree/import-fix), the problem disappeared, but another one manifested.\r\n\r\nThis time, there's a problem with importing `estimator` from tensorflow somewhere in the dependencies. Stacktrace:\r\n\r\n```Traceback (most recent call last):\r\n  File \"/usr/local/lib/python2.7/dist-packages/dataflow_worker/batchworker.py\", line 773, in run\r\n    self._load_main_session(self.local_staging_directory)\r\n  File \"/usr/local/lib/python2.7/dist-packages/dataflow_worker/batchworker.py\", line 489, in _load_main_session\r\n    pickler.load_session(session_file)\r\n  File \"/usr/local/lib/python2.7/dist-packages/apache_beam/internal/pickler.py\", line 269, in load_session\r\n    return dill.load_session(file_path)\r\n  File \"/usr/local/lib/python2.7/dist-packages/dill/_dill.py\", line 410, in load_session\r\n    module = unpickler.load()\r\n  File \"/usr/lib/python2.7/pickle.py\", line 864, in load\r\n    dispatch[key](self)\r\n  File \"/usr/lib/python2.7/pickle.py\", line 1139, in load_reduce\r\n    value = func(*args)\r\n  File \"/usr/local/lib/python2.7/dist-packages/dill/_dill.py\", line 828, in _import_module\r\n    return getattr(__import__(module, None, None, [obj]), obj)\r\n  File \"/usr/local/lib/python2.7/dist-packages/trainer/taxi.py\", line 19, in <module>\r\n    from tensorflow_transform import coders as tft_coders\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow_transform/__init__.py\", line 19, in <module>\r\n    from tensorflow_transform.analyzers import *\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow_transform/analyzers.py\", line 39, in <module>\r\n    from tensorflow_transform import tf_utils\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow_transform/tf_utils.py\", line 24, in <module>\r\n    from tensorflow.contrib.proto.python.ops import encode_proto_op\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/__init__.py\", line 48, in <module>\r\n    from tensorflow.contrib import distribute\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/distribute/__init__.py\", line 34, in <module>\r\n    from tensorflow.contrib.distribute.python.tpu_strategy import TPUStrategy\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/distribute/python/tpu_strategy.py\", line 27, in <module>\r\n    from tensorflow.contrib.tpu.python.ops import tpu_ops\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/tpu/__init__.py\", line 73, in <module>\r\n    from tensorflow.contrib.tpu.python.tpu.keras_support import tpu_model as keras_to_tpu_model\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/tpu/python/tpu/keras_support.py\", line 71, in <module>\r\n    from tensorflow.python.estimator import model_fn as model_fn_lib\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/__init__.py\", line 25, in <module>\r\n    import tensorflow.python.estimator.estimator_lib\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator_lib.py\", line 22, in <module>\r\n    from tensorflow.python.estimator.canned.baseline import BaselineClassifier\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/canned/baseline.py\", line 50, in <module>\r\n    from tensorflow.python.estimator import estimator\r\nImportError: cannot import name estimator\r\n```\r\n\r\nIs there anything I can do to fix this? \n", "before_files": [{"content": "# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Setup dependencies for local and cloud deployment.\"\"\"\nimport setuptools\n\n# LINT.IfChange\nTF_VERSION = '1.12.0'\n# LINT.ThenChange(train_mlengine.sh, start_model_server_mlengine.sh)\n\n# LINT.IfChange\nBEAM_VERSION = '2.11.0'\n# LINT.ThenChange(setup_beam_on_flink.sh)\n\nif __name__ == '__main__':\n  setuptools.setup(\n      name='tfx_chicago_taxi',\n      version='0.12.0',\n      packages=setuptools.find_packages(),\n      install_requires=[\n          'apache-beam[gcp]==' + BEAM_VERSION,\n          'jupyter==1.0',\n          'numpy==1.14.5',\n          'protobuf==3.6.1',\n          'tensorflow==' + TF_VERSION,\n          'tensorflow-data-validation==0.12.0',\n          'tensorflow-metadata==0.12.1',\n          'tensorflow-model-analysis==0.12.1',\n          'tensorflow-serving-api==1.12.0',\n          'tensorflow-transform==0.12.0',\n      ],\n      python_requires='>=2.7,<3')\n", "path": "tfx/examples/chicago_taxi/setup.py"}]}