Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
reeba212 committed Oct 4, 2024
1 parent e24ea06 commit c288f1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
3 changes: 1 addition & 2 deletions sdks/python/apache_beam/yaml/standard_providers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
gradle_target: 'sdks:java:extensions:sql:expansion-service:shadowJar'

- type: 'python'
config:
requires_gcp: true
config: {}
transforms:
Enrichment: 'apache_beam.yaml.yaml_enrichment.enrichment_transform'
16 changes: 4 additions & 12 deletions sdks/python/apache_beam/yaml/yaml_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,9 @@ def provider_from_spec(cls, spec):
result.to_json = lambda: spec
return result
except Exception as exn:
if isinstance(exn, ModuleNotFoundError) and config.get('requires_gcp',
False):
print(
f"gcp dependencies not installed. Cannot use transforms: "
f"{', '.join(urns.keys())}. Please install using "
f"'pip install apache-beam[gcp]'.")
return InlineProvider({})
else:
raise ValueError(
f'Unable to instantiate provider of type {type} '
f'at line {SafeLineLoader.get_line(spec)}: {exn}') from exn
raise ValueError(
f'Unable to instantiate provider of type {type} '
f'at line {SafeLineLoader.get_line(spec)}: {exn}') from exn
else:
raise NotImplementedError(
f'Unknown provider type: {type} '
Expand Down Expand Up @@ -343,7 +335,7 @@ def cache_artifacts(self):


@ExternalProvider.register_provider_type('python')
def python(urns, packages=(), requires_gcp=False):
def python(urns, packages=()):
if packages:
return ExternalPythonProvider(urns, packages)
else:
Expand Down

0 comments on commit c288f1a

Please sign in to comment.