You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "robertwb (via GitHub)" <gi...@apache.org> on 2023/08/09 20:45:22 UTC
[GitHub] [beam] robertwb commented on a diff in pull request #27884: Also use config pattern for yaml providers.
robertwb commented on code in PR #27884:
URL: https://github.com/apache/beam/pull/27884#discussion_r1289176728
##########
sdks/python/apache_beam/yaml/yaml_provider.py:
##########
@@ -141,38 +141,23 @@ def create_external_transform(self, urn, args):
def provider_from_spec(spec):
urns = spec['transforms']
type = spec['type']
- if spec.get('version', None) == 'BEAM_VERSION':
- spec['version'] = beam_version
+ config = spec.get('config', {})
+ if config.get('version', None) == 'BEAM_VERSION':
+ config['version'] = beam_version
if type == 'javaJar':
- return ExternalJavaProvider(urns, lambda: spec['jar'])
+ return ExternalJavaProvider(urns, **config)
elif type == 'mavenJar':
return ExternalJavaProvider(
urns,
- lambda: subprocess_server.JavaJarServer.path_to_maven_jar(
- **{
- key: value
- for (key, value) in spec.items() if key in [
- 'artifact_id',
- 'group_id',
- 'version',
- 'repository',
- 'classifier',
- 'appendix'
- ]
- }))
+ lambda: subprocess_server.JavaJarServer.path_to_maven_jar(**config))
Review Comment:
Good point. Fixed it up so the errors will be earlier and cleaner.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org