[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=104836=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-104836 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 22/May/18 22:12 Start Date: 22/May/18 22:12 Worklog Time Spent: 10m Work Description: aaltay closed pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334 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/__init__.py b/sdks/python/apache_beam/internal/__init__.py index 0bce5d68f72..84381ed71d4 100644 --- a/sdks/python/apache_beam/internal/__init__.py +++ b/sdks/python/apache_beam/internal/__init__.py @@ -16,3 +16,5 @@ # """For internal use only; no backwards-compatibility guarantees.""" + +from __future__ import absolute_import diff --git a/sdks/python/apache_beam/internal/gcp/__init__.py b/sdks/python/apache_beam/internal/gcp/__init__.py index 0bce5d68f72..84381ed71d4 100644 --- a/sdks/python/apache_beam/internal/gcp/__init__.py +++ b/sdks/python/apache_beam/internal/gcp/__init__.py @@ -16,3 +16,5 @@ # """For internal use only; no backwards-compatibility guarantees.""" + +from __future__ import absolute_import diff --git a/sdks/python/apache_beam/internal/gcp/auth.py b/sdks/python/apache_beam/internal/gcp/auth.py index 97a0ef83e85..cff88879d1a 100644 --- a/sdks/python/apache_beam/internal/gcp/auth.py +++ b/sdks/python/apache_beam/internal/gcp/auth.py @@ -17,17 +17,19 @@ """Dataflow credentials and authentication.""" +from __future__ import absolute_import + import datetime import json import logging import os +from future.moves.urllib.request import Request +from future.moves.urllib.request import urlopen from oauth2client.client import GoogleCredentials from oauth2client.client import OAuth2Credentials from apache_beam.utils import retry -from six.moves.urllib.request import Request -from six.moves.urllib.request import urlopen # When we are running in GCE, we can authenticate with VM credentials. is_running_in_gce = False diff --git a/sdks/python/apache_beam/internal/gcp/json_value.py b/sdks/python/apache_beam/internal/gcp/json_value.py index c4f3d7ba4da..a4c6fb9d135 100644 --- a/sdks/python/apache_beam/internal/gcp/json_value.py +++ b/sdks/python/apache_beam/internal/gcp/json_value.py @@ -17,6 +17,10 @@ """JSON conversion utility functions.""" +from __future__ import absolute_import + +from apache_beam.options.value_provider import ValueProvider + # Protect against environments where apitools library is not available. # pylint: disable=wrong-import-order, wrong-import-position try: @@ -25,9 +29,12 @@ extra_types = None # pylint: enable=wrong-import-order, wrong-import-position -import six - -from apache_beam.options.value_provider import ValueProvider +try: # Python 2 + unicode # pylint: disable=unicode-builtin + long# pylint: disable=long-builtin +except NameError: # Python 3 + unicode = str + long = int _MAXINT64 = (1 << 63) - 1 _MININT64 = - (1 << 63) @@ -49,7 +56,7 @@ def get_typed_value_descriptor(obj): ~exceptions.TypeError: if the Python object has a type that is not supported. """ - if isinstance(obj, six.string_types): + if isinstance(obj, (str, unicode)): type_name = 'Text' elif isinstance(obj, bool): type_name = 'Boolean' @@ -101,11 +108,11 @@ def to_json_value(obj, with_type=False): return extra_types.JsonValue(object_value=json_object) elif with_type: return to_json_value(get_typed_value_descriptor(obj), with_type=False) - elif isinstance(obj, six.string_types): + elif isinstance(obj, (str, unicode)): return extra_types.JsonValue(string_value=obj) elif isinstance(obj, bool): return extra_types.JsonValue(boolean_value=obj) - elif isinstance(obj, six.integer_types): + elif isinstance(obj, (int, long)): if _MININT64 <= obj <= _MAXINT64: return extra_types.JsonValue(integer_value=obj) else: diff --git a/sdks/python/apache_beam/internal/gcp/json_value_test.py b/sdks/python/apache_beam/internal/gcp/json_value_test.py index c22d067beea..e7cf7f15e36 100644 --- a/sdks/python/apache_beam/internal/gcp/json_value_test.py +++ b/sdks/python/apache_beam/internal/gcp/json_value_test.py @@ -17,6 +17,8 @@ """Unit tests for the json_value module.""" +from __future__ import absolute_import + import unittest from apache_beam.internal.gcp.json_value import from_json_value diff --git a/sdks/python/apache_beam/internal/module_test.py b/sdks/python/apache_beam/internal/module_test.py index
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=103532=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-103532 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 18/May/18 18:59 Start Date: 18/May/18 18:59 Worklog Time Spent: 10m Work Description: RobbeSneyders commented on a change in pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#discussion_r189364662 ## File path: sdks/python/apache_beam/internal/util.py ## @@ -20,9 +20,13 @@ For internal use only. No backwards compatibility guarantees. """ +from __future__ import absolute_import + import logging import threading import weakref +from builtins import next Review comment: I checked again, and it seems like the linter checks for `.next()` calls on objects. So we should be safe. 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: 103532) Time Spent: 2h 50m (was: 2h 40m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 2h 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=103526=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-103526 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 18/May/18 18:36 Start Date: 18/May/18 18:36 Worklog Time Spent: 10m Work Description: RobbeSneyders commented on a change in pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#discussion_r189358357 ## File path: sdks/python/tox.ini ## @@ -17,7 +17,8 @@ [tox] # new environments will be excluded by default unless explicitly added to envlist. -envlist = py27,py27-{gcp,cython,lint,lint3},py3-lint,docs +#envlist = py27,py27-{gcp,cython,lint,lint3},py3-lint,docs Review comment: My mistake. 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: 103526) Time Spent: 2h 40m (was: 2.5h) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 2h 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=103426=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-103426 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 18/May/18 16:46 Start Date: 18/May/18 16:46 Worklog Time Spent: 10m Work Description: aaltay commented on a change in pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#discussion_r189328973 ## File path: sdks/python/tox.ini ## @@ -17,7 +17,8 @@ [tox] # new environments will be excluded by default unless explicitly added to envlist. -envlist = py27,py27-{gcp,cython,lint,lint3},py3-lint,docs +#envlist = py27,py27-{gcp,cython,lint,lint3},py3-lint,docs Review comment: Revert this change? 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: 103426) Time Spent: 2.5h (was: 2h 20m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 2.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=103027=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-103027 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 18:14 Start Date: 17/May/18 18:14 Worklog Time Spent: 10m Work Description: tvalentyn commented on a change in pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#discussion_r189053386 ## File path: sdks/python/apache_beam/internal/util.py ## @@ -20,9 +20,13 @@ For internal use only. No backwards compatibility guarantees. """ +from __future__ import absolute_import + import logging import threading import weakref +from builtins import next Review comment: Hm... the change is harmless, I totally don't mind it. I am a little concerned that we might not be able to enforce consistency in the codebase, and automatically catch when such changes are required. Say, tomorrow somebody adds a usage of `next` in against an object passed into the method, and we can't tell if the object will has the iterator implemented in Py3-compliant way, so then there would be a difference in behavior between py2 and py3, and importing `next` would make a difference, but if linter does not catch it, chances are reviewers won't notice it either. 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: 103027) Time Spent: 2h 20m (was: 2h 10m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 2h 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=103022=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-103022 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 18:05 Start Date: 17/May/18 18:05 Worklog Time Spent: 10m Work Description: RobbeSneyders commented on issue #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#issuecomment-389957264 The linter did run before pushing my new changes. 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: 103022) Time Spent: 2h 10m (was: 2h) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 2h 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=103021=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-103021 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 18:05 Start Date: 17/May/18 18:05 Worklog Time Spent: 10m Work Description: RobbeSneyders commented on issue #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#issuecomment-389957264 The linter did run before pushing my new changes. The tests won't run again for some reason. 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: 103021) Time Spent: 2h (was: 1h 50m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 2h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=103020=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-103020 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 18:02 Start Date: 17/May/18 18:02 Worklog Time Spent: 10m Work Description: RobbeSneyders commented on issue #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#issuecomment-389956265 retest this please 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: 103020) Time Spent: 1h 50m (was: 1h 40m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 1h 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=103019=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-103019 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 18:02 Start Date: 17/May/18 18:02 Worklog Time Spent: 10m Work Description: RobbeSneyders commented on issue #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#issuecomment-389956265 retest this please 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: 103019) Time Spent: 1h 40m (was: 1.5h) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 1h 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=103017=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-103017 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 17:56 Start Date: 17/May/18 17:56 Worklog Time Spent: 10m Work Description: RobbeSneyders commented on a change in pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#discussion_r189047846 ## File path: sdks/python/apache_beam/internal/util.py ## @@ -20,9 +20,13 @@ For internal use only. No backwards compatibility guarantees. """ +from __future__ import absolute_import + import logging import threading import weakref +from builtins import next Review comment: This is indeed done by the automatic conversion of future. And you're right, it isn't necessary here. Lint doesn't seem to complain either, so we can remove this. 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: 103017) Time Spent: 1.5h (was: 1h 20m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 1.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=102992=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-102992 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 17:08 Start Date: 17/May/18 17:08 Worklog Time Spent: 10m Work Description: tvalentyn commented on issue #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#issuecomment-389939960 Let's see if the Py3 linter kicks in. 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: 102992) Time Spent: 1h 20m (was: 1h 10m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 1h 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=102991=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-102991 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 17:07 Start Date: 17/May/18 17:07 Worklog Time Spent: 10m Work Description: tvalentyn commented on issue #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#issuecomment-389939842 retest this please 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: 102991) Time Spent: 1h 10m (was: 1h) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 1h 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=102757=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-102757 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 02:00 Start Date: 17/May/18 02:00 Worklog Time Spent: 10m Work Description: tvalentyn commented on a change in pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#discussion_r188820867 ## File path: sdks/python/apache_beam/internal/util.py ## @@ -20,9 +20,13 @@ For internal use only. No backwards compatibility guarantees. """ +from __future__ import absolute_import + import logging import threading import weakref +from builtins import next Review comment: I'd like to understand the reason for adding `from builtins import next`. Is it done by a conversion tool because we have an occurrence of `next(v_iter)` in the file, and the tool cannot infer whether or not v_iter implements a custom iterator? If yes: will such changes be required by linter? Is my understanding correct that as long as `v_iter.__class__` does not implement a custom iterator (and it is not, in our case), the code without the import is still equivalent in Python 2 and Python 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: 102757) Time Spent: 1h (was: 50m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 1h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=102756=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-102756 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 02:00 Start Date: 17/May/18 02:00 Worklog Time Spent: 10m Work Description: tvalentyn commented on a change in pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#discussion_r188820867 ## File path: sdks/python/apache_beam/internal/util.py ## @@ -20,9 +20,13 @@ For internal use only. No backwards compatibility guarantees. """ +from __future__ import absolute_import + import logging import threading import weakref +from builtins import next Review comment: I'd like to understand the reason for adding `from builtins import next`. Is it done by a conversion tool because we have an occurrence of `next(v_iter)` in the file, and the tool cannot infer whether or not v_iter implements a custom iterator? If yes: will such changes be required by linter? Is my understanding correct that as long as `v_iter.__class__` class does not implement a custom iterator (and it is not, in our case), the code without the import is still equivalent in Python 2 and Python 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: 102756) Time Spent: 50m (was: 40m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=102754=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-102754 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 01:59 Start Date: 17/May/18 01:59 Worklog Time Spent: 10m Work Description: tvalentyn commented on a change in pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#discussion_r188820867 ## File path: sdks/python/apache_beam/internal/util.py ## @@ -20,9 +20,13 @@ For internal use only. No backwards compatibility guarantees. """ +from __future__ import absolute_import + import logging import threading import weakref +from builtins import next Review comment: I'd like to understand the reason for adding `from builtins import next`. Is it done by a conversion tool because we have an occurrence of `next(v_iter)` in the file, and the tool cannot infer whether or not v_iter implements a custom iterator? If yes: will such changes be required by linter? Is my understanding correct that as long as v_iter's class does not implement a custom iterator (and it is not, in our case), the code without the import is still equivalent in Python 2 and Python 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: 102754) Time Spent: 0.5h (was: 20m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 0.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=102755=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-102755 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 17/May/18 01:59 Start Date: 17/May/18 01:59 Worklog Time Spent: 10m Work Description: tvalentyn commented on a change in pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#discussion_r188820867 ## File path: sdks/python/apache_beam/internal/util.py ## @@ -20,9 +20,13 @@ For internal use only. No backwards compatibility guarantees. """ +from __future__ import absolute_import + import logging import threading import weakref +from builtins import next Review comment: I'd like to understand the reason for adding `from builtins import next`. Is it done by a conversion tool because we have an occurrence of `next(v_iter)` in the file, and the tool cannot infer whether or not v_iter implements a custom iterator? If yes: will such changes be required by linter? Is my understanding correct that as long as `v_iter`'s class does not implement a custom iterator (and it is not, in our case), the code without the import is still equivalent in Python 2 and Python 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: 102755) Time Spent: 40m (was: 0.5h) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=101448=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-101448 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 12/May/18 10:04 Start Date: 12/May/18 10:04 Worklog Time Spent: 10m Work Description: RobbeSneyders commented on issue #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334#issuecomment-388544578 retest this please 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: 101448) Time Spent: 20m (was: 10m) > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3999) Futurize and fix python 2 compatibility for internal subpackage
[ https://issues.apache.org/jira/browse/BEAM-3999?focusedWorklogId=101085=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-101085 ] ASF GitHub Bot logged work on BEAM-3999: Author: ASF GitHub Bot Created on: 11/May/18 11:28 Start Date: 11/May/18 11:28 Worklog Time Spent: 10m Work Description: RobbeSneyders opened a new pull request #5334: [BEAM-3999] Futurize internal subpackage URL: https://github.com/apache/beam/pull/5334 This pull request prepares the internal 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) 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: 101085) Time Spent: 10m Remaining Estimate: 0h > Futurize and fix python 2 compatibility for internal subpackage > --- > > Key: BEAM-3999 > URL: https://issues.apache.org/jira/browse/BEAM-3999 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: Robbe >Assignee: Robbe >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)