[
https://issues.apache.org/jira/browse/BEAM-13939?focusedWorklogId=737913&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-737913
]
ASF GitHub Bot logged work on BEAM-13939:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 08/Mar/22 02:35
Start Date: 08/Mar/22 02:35
Worklog Time Spent: 10m
Work Description: thempatel commented on a change in pull request #16961:
URL: https://github.com/apache/beam/pull/16961#discussion_r821271718
##########
File path: sdks/python/apache_beam/portability/api/__init__.py
##########
@@ -1,21 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-"""For internal use only; no backwards-compatibility guarantees.
-
-Automatically generated when running setup.py sdist or build[_py].
Review comment:
This file removed in favor of a real autogenerated file. The new file
looks something like:
```python
from .org.apache.beam.model import pipeline
from .org.apache.beam.model import jobmanagement
from .org.apache.beam.model import fnexecution
from .org.apache.beam.model import interactive
external_transforms_pb2 = pipeline.external_transforms_pb2
metrics_pb2_grpc = pipeline.metrics_pb2_grpc
schema_pb2_grpc = pipeline.schema_pb2_grpc
beam_runner_api_pb2_urns = pipeline.beam_runner_api_pb2_urns
schema_pb2 = pipeline.schema_pb2
metrics_pb2 = pipeline.metrics_pb2
external_transforms_pb2_grpc = pipeline.external_transforms_pb2_grpc
standard_window_fns_pb2_urns = pipeline.standard_window_fns_pb2_urns
standard_window_fns_pb2_grpc = pipeline.standard_window_fns_pb2_grpc
endpoints_pb2 = pipeline.endpoints_pb2
standard_window_fns_pb2 = pipeline.standard_window_fns_pb2
external_transforms_pb2_urns = pipeline.external_transforms_pb2_urns
metrics_pb2_urns = pipeline.metrics_pb2_urns
beam_runner_api_pb2 = pipeline.beam_runner_api_pb2
endpoints_pb2_grpc = pipeline.endpoints_pb2_grpc
beam_runner_api_pb2_grpc = pipeline.beam_runner_api_pb2_grpc
beam_artifact_api_pb2_urns = jobmanagement.beam_artifact_api_pb2_urns
beam_expansion_api_pb2_grpc = jobmanagement.beam_expansion_api_pb2_grpc
beam_artifact_api_pb2 = jobmanagement.beam_artifact_api_pb2
beam_artifact_api_pb2_grpc = jobmanagement.beam_artifact_api_pb2_grpc
beam_job_api_pb2 = jobmanagement.beam_job_api_pb2
beam_job_api_pb2_grpc = jobmanagement.beam_job_api_pb2_grpc
beam_expansion_api_pb2 = jobmanagement.beam_expansion_api_pb2
beam_fn_api_pb2_grpc = fnexecution.beam_fn_api_pb2_grpc
beam_provision_api_pb2 = fnexecution.beam_provision_api_pb2
beam_provision_api_pb2_grpc = fnexecution.beam_provision_api_pb2_grpc
beam_fn_api_pb2 = fnexecution.beam_fn_api_pb2
beam_interactive_api_pb2_grpc = interactive.beam_interactive_api_pb2_grpc
beam_interactive_api_pb2 = interactive.beam_interactive_api_pb2
```
This allows imports of the form:
```python
from apache_beam.portability.api import beam_interactive_api_pb2
```
without the rest of the sdk needing to know the shape of the generated
bindings
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 737913)
Time Spent: 5h 20m (was: 5h 10m)
> Go SDK: Protobuf namespace conflict
> -----------------------------------
>
> Key: BEAM-13939
> URL: https://issues.apache.org/jira/browse/BEAM-13939
> Project: Beam
> Issue Type: Improvement
> Components: beam-model, sdk-go
> Affects Versions: 2.36.0
> Reporter: Milan Patel
> Priority: P2
> Labels: easyfix
> Attachments: demobug.zip
>
> Time Spent: 5h 20m
> Remaining Estimate: 0h
>
> The Go SDK generated grpc protobufs are not namespaced with enough
> granularity. If a user has another external dependency with the same protobuf
> file registered with the proto runtime, their compiled binary will panic at
> runtime pointing the user to this [doc
> page|https://developers.google.com/protocol-buffers/docs/reference/go/faq#fix-namespace-conflict].
>
> In the interim, following the instructions to add either ldflags to the
> compiler or an environment var to the binary works, but this is an unideal
> solution since only one of the duplicate proto specifications will be
> accessible from a [global
> registry|https://pkg.go.dev/google.golang.org/[email protected]/reflect/protoregistry].
>
> Ask: Regenerate the go protos such that descriptors like
> [these|https://github.com/apache/beam/blob/84353a7c973d3acaaa56d81c265dce7193a56be5/sdks/go/pkg/beam/model/pipeline_v1/metrics.pb.go#L797-L811]
> are outputted with filenames that are more granular, such as a filename that
> includes the directory structure of the repository.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)