Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit c14695b

Browse files
gcf-owl-bot[bot]software-dovparthea
authored
fix: rename mapping attribute of AudioStream to mapping_ (#121)
fix: resolve issue where mapping attribute of AudioStream could not be set fix(deps): require proto-plus >= 1.20.1 * chore: use gapic-generator-python 0.58.4 committer: dovs PiperOrigin-RevId: 419025932 Source-Link: googleapis/googleapis@73da669 Source-Link: https://github.com/googleapis/googleapis-gen/commit/46df624a54b9ed47c1a7eefb7a49413cf7b82f98 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDZkZjYyNGE1NGI5ZWQ0N2MxYTdlZWZiN2E0OTQxM2NmN2I4MmY5OCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): require proto-plus >= 1.20.1 * ensure proto-plus>=1.20.1 is used for testing Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Dov Shlachter <[email protected]> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent e30431f commit c14695b

File tree

12 files changed

+115
-198
lines changed

12 files changed

+115
-198
lines changed

google/cloud/video/transcoder_v1/services/transcoder_service/transports/base.py

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ def __init__(
103103
credentials, _ = google.auth.load_credentials_from_file(
104104
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
105105
)
106-
107106
elif credentials is None:
108107
credentials, _ = google.auth.default(
109108
**scopes_kwargs, quota_project_id=quota_project_id

google/cloud/video/transcoder_v1/types/resources.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ class AudioStream(proto.Message):
13451345
- ``sr`` - Side right channel
13461346
- ``fc`` - Front center channel
13471347
- ``lfe`` - Low frequency
1348-
mapping (Sequence[google.cloud.video.transcoder_v1.types.AudioStream.AudioMapping]):
1348+
mapping_ (Sequence[google.cloud.video.transcoder_v1.types.AudioStream.AudioMapping]):
13491349
The mapping for the ``Job.edit_list`` atoms with audio
13501350
``EditAtom.inputs``.
13511351
sample_rate_hertz (int):
@@ -1389,7 +1389,7 @@ class AudioMapping(proto.Message):
13891389
bitrate_bps = proto.Field(proto.INT32, number=2,)
13901390
channel_count = proto.Field(proto.INT32, number=3,)
13911391
channel_layout = proto.RepeatedField(proto.STRING, number=4,)
1392-
mapping = proto.RepeatedField(proto.MESSAGE, number=5, message=AudioMapping,)
1392+
mapping_ = proto.RepeatedField(proto.MESSAGE, number=5, message=AudioMapping,)
13931393
sample_rate_hertz = proto.Field(proto.INT32, number=6,)
13941394

13951395

@@ -1408,7 +1408,7 @@ class TextStream(proto.Message):
14081408
- ``cea608``
14091409
- ``cea708``
14101410
- ``webvtt``
1411-
mapping (Sequence[google.cloud.video.transcoder_v1.types.TextStream.TextMapping]):
1411+
mapping_ (Sequence[google.cloud.video.transcoder_v1.types.TextStream.TextMapping]):
14121412
The mapping for the ``Job.edit_list`` atoms with text
14131413
``EditAtom.inputs``.
14141414
"""
@@ -1433,7 +1433,7 @@ class TextMapping(proto.Message):
14331433
input_track = proto.Field(proto.INT32, number=3,)
14341434

14351435
codec = proto.Field(proto.STRING, number=1,)
1436-
mapping = proto.RepeatedField(proto.MESSAGE, number=3, message=TextMapping,)
1436+
mapping_ = proto.RepeatedField(proto.MESSAGE, number=3, message=TextMapping,)
14371437

14381438

14391439
class SegmentSettings(proto.Message):

google/cloud/video/transcoder_v1beta1/services/transcoder_service/transports/base.py

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ def __init__(
103103
credentials, _ = google.auth.load_credentials_from_file(
104104
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
105105
)
106-
107106
elif credentials is None:
108107
credentials, _ = google.auth.default(
109108
**scopes_kwargs, quota_project_id=quota_project_id

google/cloud/video/transcoder_v1beta1/types/resources.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ class AudioStream(proto.Message):
10931093
- 'sr' - Side right channel
10941094
- 'fc' - Front center channel
10951095
- 'lfe' - Low frequency
1096-
mapping (Sequence[google.cloud.video.transcoder_v1beta1.types.AudioStream.AudioAtom]):
1096+
mapping_ (Sequence[google.cloud.video.transcoder_v1beta1.types.AudioStream.AudioAtom]):
10971097
The mapping for the ``Job.edit_list`` atoms with audio
10981098
``EditAtom.inputs``.
10991099
sample_rate_hertz (int):
@@ -1161,7 +1161,7 @@ class AudioChannelInput(proto.Message):
11611161
bitrate_bps = proto.Field(proto.INT32, number=2,)
11621162
channel_count = proto.Field(proto.INT32, number=3,)
11631163
channel_layout = proto.RepeatedField(proto.STRING, number=4,)
1164-
mapping = proto.RepeatedField(proto.MESSAGE, number=5, message=AudioAtom,)
1164+
mapping_ = proto.RepeatedField(proto.MESSAGE, number=5, message=AudioAtom,)
11651165
sample_rate_hertz = proto.Field(proto.INT32, number=6,)
11661166

11671167

@@ -1184,7 +1184,7 @@ class TextStream(proto.Message):
11841184
Required. The BCP-47 language code, such as ``"en-US"`` or
11851185
``"sr-Latn"``. For more information, see
11861186
https://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1187-
mapping (Sequence[google.cloud.video.transcoder_v1beta1.types.TextStream.TextAtom]):
1187+
mapping_ (Sequence[google.cloud.video.transcoder_v1beta1.types.TextStream.TextAtom]):
11881188
The mapping for the ``Job.edit_list`` atoms with text
11891189
``EditAtom.inputs``.
11901190
"""
@@ -1223,7 +1223,7 @@ class TextInput(proto.Message):
12231223

12241224
codec = proto.Field(proto.STRING, number=1,)
12251225
language_code = proto.Field(proto.STRING, number=2,)
1226-
mapping = proto.RepeatedField(proto.MESSAGE, number=3, message=TextAtom,)
1226+
mapping_ = proto.RepeatedField(proto.MESSAGE, number=3, message=TextAtom,)
12271227

12281228

12291229
class SegmentSettings(proto.Message):

samples/snippets/create_job_with_embedded_captions.py

+7-24
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@
3232

3333

3434
def create_job_with_embedded_captions(
35-
project_id,
36-
location,
37-
input_video_uri,
38-
input_captions_uri,
39-
output_uri,
35+
project_id, location, input_video_uri, input_captions_uri, output_uri,
4036
):
4137
"""Creates a job based on an ad-hoc job configuration that embeds captions in the output video.
4238
@@ -57,19 +53,12 @@ def create_job_with_embedded_captions(
5753
job.output_uri = output_uri
5854
job.config = transcoder_v1.types.JobConfig(
5955
inputs=[
60-
transcoder_v1.types.Input(
61-
key="input0",
62-
uri=input_video_uri,
63-
),
64-
transcoder_v1.types.Input(
65-
key="caption-input0",
66-
uri=input_captions_uri,
67-
),
56+
transcoder_v1.types.Input(key="input0", uri=input_video_uri,),
57+
transcoder_v1.types.Input(key="caption-input0", uri=input_captions_uri,),
6858
],
6959
edit_list=[
7060
transcoder_v1.types.EditAtom(
71-
key="atom0",
72-
inputs=["input0", "caption-input0"],
61+
key="atom0", inputs=["input0", "caption-input0"],
7362
),
7463
],
7564
elementary_streams=[
@@ -131,9 +120,7 @@ def create_job_with_embedded_captions(
131120
elementary_streams=["video-stream0", "audio-stream0"],
132121
),
133122
transcoder_v1.types.MuxStream(
134-
key="sd-dash",
135-
container="fmp4",
136-
elementary_streams=["video-stream0"],
123+
key="sd-dash", container="fmp4", elementary_streams=["video-stream0"],
137124
),
138125
transcoder_v1.types.MuxStream(
139126
key="audio-dash",
@@ -143,9 +130,7 @@ def create_job_with_embedded_captions(
143130
],
144131
manifests=[
145132
transcoder_v1.types.Manifest(
146-
file_name="manifest.m3u8",
147-
type_="HLS",
148-
mux_streams=["sd-hls"],
133+
file_name="manifest.m3u8", type_="HLS", mux_streams=["sd-hls"],
149134
),
150135
transcoder_v1.types.Manifest(
151136
file_name="manifest.mpd",
@@ -165,9 +150,7 @@ def create_job_with_embedded_captions(
165150
parser = argparse.ArgumentParser()
166151
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
167152
parser.add_argument(
168-
"--location",
169-
help="The location to start this job in.",
170-
default="us-central1",
153+
"--location", help="The location to start this job in.", default="us-central1",
171154
)
172155
parser.add_argument(
173156
"--input_video_uri",

samples/snippets/create_job_with_standalone_captions.py

+6-21
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333

3434

3535
def create_job_with_standalone_captions(
36-
project_id,
37-
location,
38-
input_video_uri,
39-
input_captions_uri,
40-
output_uri,
36+
project_id, location, input_video_uri, input_captions_uri, output_uri,
4137
):
4238
"""Creates a job based on an ad-hoc job configuration that can use captions from a standalone file.
4339
@@ -58,19 +54,12 @@ def create_job_with_standalone_captions(
5854
job.output_uri = output_uri
5955
job.config = transcoder_v1.types.JobConfig(
6056
inputs=[
61-
transcoder_v1.types.Input(
62-
key="input0",
63-
uri=input_video_uri,
64-
),
65-
transcoder_v1.types.Input(
66-
key="caption-input0",
67-
uri=input_captions_uri,
68-
),
57+
transcoder_v1.types.Input(key="input0", uri=input_video_uri,),
58+
transcoder_v1.types.Input(key="caption-input0", uri=input_captions_uri,),
6959
],
7060
edit_list=[
7161
transcoder_v1.types.EditAtom(
72-
key="atom0",
73-
inputs=["input0", "caption-input0"],
62+
key="atom0", inputs=["input0", "caption-input0"],
7463
),
7564
],
7665
elementary_streams=[
@@ -136,9 +125,7 @@ def create_job_with_standalone_captions(
136125
container="vtt",
137126
elementary_streams=["vtt-stream0"],
138127
segment_settings=transcoder_v1.types.SegmentSettings(
139-
segment_duration=duration.Duration(
140-
seconds=6,
141-
),
128+
segment_duration=duration.Duration(seconds=6,),
142129
individual_segments=True,
143130
),
144131
),
@@ -162,9 +149,7 @@ def create_job_with_standalone_captions(
162149
parser = argparse.ArgumentParser()
163150
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
164151
parser.add_argument(
165-
"--location",
166-
help="The location to start this job in.",
167-
default="us-central1",
152+
"--location", help="The location to start this job in.", default="us-central1",
168153
)
169154
parser.add_argument(
170155
"--input_video_uri",

samples/snippets/job_test.py

+9-15
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@
6363
output_uri_for_animated_overlay = (
6464
f"gs://{output_bucket_name}/test-output-animated-overlay/"
6565
)
66-
output_uri_for_embedded_captions = f"gs://{output_bucket_name}/test-output-embedded-captions/"
67-
output_uri_for_standalone_captions = f"gs://{output_bucket_name}/test-output-standalone-captions/"
66+
output_uri_for_embedded_captions = (
67+
f"gs://{output_bucket_name}/test-output-embedded-captions/"
68+
)
69+
output_uri_for_standalone_captions = (
70+
f"gs://{output_bucket_name}/test-output-standalone-captions/"
71+
)
6872

6973
small_spritesheet_file_prefix = "small-sprite-sheet"
7074
large_spritesheet_file_prefix = "large-sprite-sheet"
@@ -267,10 +271,7 @@ def test_create_job_with_animated_overlay(capsys, test_bucket):
267271

268272
def test_create_job_with_set_number_spritesheet(capsys, test_bucket):
269273
create_job_with_set_number_images_spritesheet.create_job_with_set_number_images_spritesheet(
270-
project_id,
271-
location,
272-
input_uri,
273-
output_uri_for_set_number_spritesheet,
274+
project_id, location, input_uri, output_uri_for_set_number_spritesheet,
274275
)
275276
out, _ = capsys.readouterr()
276277
job_name_prefix = f"projects/{project_number}/locations/{location}/jobs/"
@@ -318,10 +319,7 @@ def test_create_job_with_set_number_spritesheet(capsys, test_bucket):
318319

319320
def test_create_job_with_periodic_spritesheet(capsys, test_bucket):
320321
create_job_with_periodic_images_spritesheet.create_job_with_periodic_images_spritesheet(
321-
project_id,
322-
location,
323-
input_uri,
324-
output_uri_for_periodic_spritesheet,
322+
project_id, location, input_uri, output_uri_for_periodic_spritesheet,
325323
)
326324
out, _ = capsys.readouterr()
327325
job_name_prefix = f"projects/{project_number}/locations/{location}/jobs/"
@@ -409,11 +407,7 @@ def test_create_job_with_concatenated_inputs(capsys, test_bucket):
409407

410408
def test_create_job_with_embedded_captions(capsys, test_bucket):
411409
create_job_with_embedded_captions.create_job_with_embedded_captions(
412-
project_id,
413-
location,
414-
input_uri,
415-
captions_uri,
416-
output_uri_for_embedded_captions,
410+
project_id, location, input_uri, captions_uri, output_uri_for_embedded_captions,
417411
)
418412
out, _ = capsys.readouterr()
419413
job_name_prefix = f"projects/{project_number}/locations/{location}/jobs/"
+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
backoff==1.11.1
22
google-cloud-storage==1.43.0
33
pytest==6.2.4
4+
proto-plus>=1.20.1

setup.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@
4545
# Until this issue is closed
4646
# https://github.com/googleapis/google-cloud-python/issues/10566
4747
"google-api-core[grpc] >= 1.28.0, <3.0.0dev",
48-
"proto-plus >= 1.4.0",
48+
# Require proto-plus >= 1.20.1 which includes
49+
# a fix to mitigate collisions in field names, specifically
50+
# the `mapping` term which is a reserved term in proto-plus.
51+
# https://github.com/googleapis/proto-plus-python/pull/295
52+
"proto-plus >= 1.20.1",
4953
),
5054
python_requires=">=3.6",
5155
classifiers=[

testing/constraints-3.6.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
77
# Then this file should have foo==1.14.0
88
google-api-core==1.28.0
9-
proto-plus==1.4.0
9+
proto-plus==1.20.1

0 commit comments

Comments
 (0)