Skip to content

Commit

Permalink
Remove implicitly defined IOs. (#28479)
Browse files Browse the repository at this point in the history
We should be explicit about which IOs we support and their signatures.
  • Loading branch information
robertwb authored Sep 15, 2023
1 parent 38720a3 commit 1f980ea
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions sdks/python/apache_beam/yaml/yaml_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,4 @@ def raise_exception(failed_row_with_error):

def io_providers():
with open(os.path.join(os.path.dirname(__file__), 'standard_io.yaml')) as fin:
explicit_ios = yaml_provider.parse_providers(
yaml.load(fin, Loader=yaml.SafeLoader))

# TOOD(yaml): We should make all top-level IOs explicit.
# This will be a chance to clean up the APIs and align them with their
# Java implementations.
# PythonTransform can be used to get the "raw" transforms for any others.
implicit_ios = yaml_provider.InlineProvider({
key: getattr(beam.io, key)
for key in dir(beam.io)
if (key.startswith('ReadFrom') or key.startswith('WriteTo')) and
key not in explicit_ios
})

return yaml_provider.merge_providers(explicit_ios, implicit_ios)
return yaml_provider.parse_providers(yaml.load(fin, Loader=yaml.SafeLoader))

0 comments on commit 1f980ea

Please sign in to comment.