Skip to content

Commit

Permalink
Reviewer comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltay committed Apr 18, 2017
1 parent c9f17a6 commit 9618070
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions sdks/python/apache_beam/io/filebasedsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ def __init__(self,
IOError: when the file pattern specified yields an empty result.
"""

if (not (isinstance(file_pattern, basestring)
or isinstance(file_pattern, ValueProvider))):
if not isinstance(file_pattern, (basestring, ValueProvider)):
raise TypeError('%s: file_pattern must be of type string'
' or ValueProvider; got %r instead'
% (self.__class__.__name__, file_pattern))
Expand Down
6 changes: 2 additions & 4 deletions sdks/python/apache_beam/io/fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,10 @@ def __init__(self,
or if compression_type is not member of CompressionTypes.
ValueError: if shard_name_template is not of expected format.
"""
if not (isinstance(file_path_prefix, basestring)
or isinstance(file_path_prefix, ValueProvider)):
if not isinstance(file_path_prefix, (basestring, ValueProvider)):
raise TypeError('file_path_prefix must be a string or ValueProvider;'
'got %r instead' % file_path_prefix)
if not (isinstance(file_name_suffix, basestring)
or isinstance(file_name_suffix, ValueProvider)):
if not isinstance(file_name_suffix, (basestring, ValueProvider)):
raise TypeError('file_name_suffix must be a string or ValueProvider;'
'got %r instead' % file_name_suffix)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def __init__(self, packages, options, environment_version):
options_dict = {k: v
for k, v in sdk_pipeline_options.iteritems()
if v is not None}
options_dict['_options_id'] = 0 # TODO(altay): Remove.
options_dict['_options_id'] = 0 # TODO(BEAM-1999): Remove.
self.proto.sdkPipelineOptions.additionalProperties.append(
dataflow.Environment.SdkPipelineOptionsValue.AdditionalProperty(
key='options', value=to_json_value(options_dict)))
Expand Down
2 changes: 1 addition & 1 deletion sdks/python/apache_beam/utils/value_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get(self):
value = self.default_value
return value

# TODO(altay): Remove _unused_options_id
# TODO(BEAM-1999): Remove _unused_options_id
@classmethod
def set_runtime_options(cls, _unused_options_id, pipeline_options):
RuntimeValueProvider.runtime_options = pipeline_options
Expand Down

0 comments on commit 9618070

Please sign in to comment.