Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdks/python/apache_beam/options/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import absolute_import
7 changes: 5 additions & 2 deletions sdks/python/apache_beam/options/pipeline_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/options/pipeline_options_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

"""Unit tests for the pipeline options module."""

from __future__ import absolute_import

import logging
import unittest

Expand Down
3 changes: 3 additions & 0 deletions sdks/python/apache_beam/options/pipeline_options_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions sdks/python/apache_beam/options/value_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions sdks/python/apache_beam/options/value_provider_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#

"""Unit tests for the ValueProvider class."""

from __future__ import absolute_import

import logging
import unittest

Expand Down
1 change: 1 addition & 0 deletions sdks/python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ deps =
modules =
apache_beam/coders
apache_beam/metrics
apache_beam/options
commands =
python --version
pip --version
Expand Down