[jira] [Work logged] (BEAM-4002) Futurize and fix python 2 compatibility for options subpackage

2018-05-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot logged work on BEAM-4002:


Author: ASF GitHub Bot
Created on: 22/May/18 22:06
Start Date: 22/May/18 22:06
Worklog Time Spent: 10m 
  Work Description: aaltay closed pull request #5339: [BEAM-4002] Futurize 
options subpackage
URL: https://github.com/apache/beam/pull/5339
 
 
   

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/options/__init__.py 
b/sdks/python/apache_beam/options/__init__.py
index cce3acad34a..f4f43cbb123 100644
--- a/sdks/python/apache_beam/options/__init__.py
+++ b/sdks/python/apache_beam/options/__init__.py
@@ -14,3 +14,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+from __future__ import absolute_import
diff --git a/sdks/python/apache_beam/options/pipeline_options.py 
b/sdks/python/apache_beam/options/pipeline_options.py
index b5f9d77617d..0c96325d70c 100644
--- a/sdks/python/apache_beam/options/pipeline_options.py
+++ b/sdks/python/apache_beam/options/pipeline_options.py
@@ -17,7 +17,10 @@
 
 """Pipeline options obtained from command line parsing."""
 
+from __future__ import absolute_import
+
 import argparse
+from builtins import object
 
 from apache_beam.options.value_provider import RuntimeValueProvider
 from apache_beam.options.value_provider import StaticValueProvider
@@ -175,7 +178,7 @@ def from_dictionary(cls, options):
   A PipelineOptions object representing the given arguments.
 """
 flags = []
-for k, v in options.iteritems():
+for k, v in options.items():
   if isinstance(v, bool):
 if v:
   flags.append('--%s' % k)
@@ -233,7 +236,7 @@ def _visible_option_list(self):
   for option in dir(self._visible_options) if option[0] != '_')
 
   def __dir__(self):
-return sorted(dir(type(self)) + self.__dict__.keys() +
+return sorted(dir(type(self)) + list(self.__dict__.keys()) +
   self._visible_option_list())
 
   def __getattr__(self, name):
diff --git a/sdks/python/apache_beam/options/pipeline_options_test.py 
b/sdks/python/apache_beam/options/pipeline_options_test.py
index 66c69bdfc70..289e67f15fe 100644
--- a/sdks/python/apache_beam/options/pipeline_options_test.py
+++ b/sdks/python/apache_beam/options/pipeline_options_test.py
@@ -17,6 +17,8 @@
 
 """Unit tests for the pipeline options module."""
 
+from __future__ import absolute_import
+
 import logging
 import unittest
 
diff --git a/sdks/python/apache_beam/options/pipeline_options_validator.py 
b/sdks/python/apache_beam/options/pipeline_options_validator.py
index 24d2e55eadb..874e739fb61 100644
--- a/sdks/python/apache_beam/options/pipeline_options_validator.py
+++ b/sdks/python/apache_beam/options/pipeline_options_validator.py
@@ -19,7 +19,10 @@
 
 For internal use only; no backwards-compatibility guarantees.
 """
+from __future__ import absolute_import
+
 import re
+from builtins import object
 
 from apache_beam.internal import pickler
 from apache_beam.options.pipeline_options import DebugOptions
diff --git a/sdks/python/apache_beam/options/pipeline_options_validator_test.py 
b/sdks/python/apache_beam/options/pipeline_options_validator_test.py
index 8ff66c78f17..c0582e2f7d1 100644
--- a/sdks/python/apache_beam/options/pipeline_options_validator_test.py
+++ b/sdks/python/apache_beam/options/pipeline_options_validator_test.py
@@ -17,8 +17,11 @@
 
 """Unit tests for the pipeline options validator module."""
 
+from __future__ import absolute_import
+
 import logging
 import unittest
+from builtins import object
 
 from hamcrest.core.base_matcher import BaseMatcher
 
diff --git a/sdks/python/apache_beam/options/value_provider.py 
b/sdks/python/apache_beam/options/value_provider.py
index 4aaa0f74474..0ef83e344c9 100644
--- a/sdks/python/apache_beam/options/value_provider.py
+++ b/sdks/python/apache_beam/options/value_provider.py
@@ -19,6 +19,9 @@
 and dynamically provided values.
 """
 
+from __future__ import absolute_import
+
+from builtins import object
 from functools import wraps
 
 from apache_beam import error
@@ -66,6 +69,9 @@ def __eq__(self, other):
 return True
 return False
 
+  def __hash__(self):
+return hash((type(self), self.value_type, self.value))
+
 
 class RuntimeValueProvider(ValueProvider):
   runtime_options = None
diff --git a/sdks/python/apache_beam/options/value_provider_test.py 
b/sdks/python/apache_beam/options/value_provider_test.py
index 482ea47504a..bc027148234 100644
--- 

[jira] [Work logged] (BEAM-4002) Futurize and fix python 2 compatibility for options subpackage

2018-05-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot logged work on BEAM-4002:


Author: ASF GitHub Bot
Created on: 22/May/18 07:29
Start Date: 22/May/18 07:29
Worklog Time Spent: 10m 
  Work Description: Fematich commented on issue #5339: [BEAM-4002] Futurize 
options subpackage
URL: https://github.com/apache/beam/pull/5339#issuecomment-390890864
 
 
   Rebased now!


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: 104523)
Time Spent: 20m  (was: 10m)

> Futurize and fix python 2 compatibility for options subpackage
> --
>
> Key: BEAM-4002
> URL: https://issues.apache.org/jira/browse/BEAM-4002
> Project: Beam
>  Issue Type: Sub-task
>  Components: sdk-py-core
>Reporter: Robbe
>Assignee: Matthias Feys
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




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


[jira] [Work logged] (BEAM-4002) Futurize and fix python 2 compatibility for options subpackage

2018-05-11 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot logged work on BEAM-4002:


Author: ASF GitHub Bot
Created on: 11/May/18 17:34
Start Date: 11/May/18 17:34
Worklog Time Spent: 10m 
  Work Description: Fematich opened a new pull request #5339: [BEAM-4002] 
Futurize options subpackage
URL: https://github.com/apache/beam/pull/5339
 
 
   This pull request prepares the options subpackage for Python 3 support. This 
PR is part of a series in which all subpackages will be updated using the same 
approach.
   This approach has been documented 
[here](https://docs.google.com/document/d/1xDG0MWVlDKDPu_IW9gtMvxi2S9I0GB0VDTkPhjXT0nE/edit#)
 and the first pull request in the series (Futurize coders subpackage) 
demonstrating this approach can be found at #5053.
   
   R: @aaltay @tvalentyn


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: 101216)
Time Spent: 10m
Remaining Estimate: 0h

> Futurize and fix python 2 compatibility for options subpackage
> --
>
> Key: BEAM-4002
> URL: https://issues.apache.org/jira/browse/BEAM-4002
> Project: Beam
>  Issue Type: Sub-task
>  Components: sdk-py-core
>Reporter: Robbe
>Assignee: Matthias Feys
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>




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