Skip to content

Commit 472d830

Browse files
ilevkivskyiIvan Levkivskyi
andauthored
Fix well known types in protobuf stubs (#4845)
Co-authored-by: Ivan Levkivskyi <[email protected]>
1 parent 3242076 commit 472d830

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

third_party/2and3/google/protobuf/any_pb2.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ from google.protobuf.message import (
99
Message as google___protobuf___message___Message,
1010
)
1111

12+
from google.protobuf.internal import well_known_types
13+
1214
from typing import (
1315
Optional as typing___Optional,
1416
Text as typing___Text,
@@ -27,7 +29,7 @@ builtin___int = int
2729

2830
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
2931

30-
class Any(google___protobuf___message___Message):
32+
class Any(google___protobuf___message___Message, well_known_types.Any_):
3133
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
3234
type_url: typing___Text = ...
3335
value: builtin___bytes = ...

third_party/2and3/google/protobuf/duration_pb2.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ from google.protobuf.message import (
99
Message as google___protobuf___message___Message,
1010
)
1111

12+
from google.protobuf.internal import well_known_types
13+
1214
from typing import (
1315
Optional as typing___Optional,
1416
)
@@ -26,7 +28,7 @@ builtin___int = int
2628

2729
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
2830

29-
class Duration(google___protobuf___message___Message):
31+
class Duration(google___protobuf___message___Message, well_known_types.Duration):
3032
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
3133
seconds: builtin___int = ...
3234
nanos: builtin___int = ...

third_party/2and3/google/protobuf/field_mask_pb2.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ from google.protobuf.message import (
1313
Message as google___protobuf___message___Message,
1414
)
1515

16+
from google.protobuf.internal import well_known_types
17+
1618
from typing import (
1719
Iterable as typing___Iterable,
1820
Optional as typing___Optional,
@@ -32,7 +34,7 @@ builtin___int = int
3234

3335
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
3436

35-
class FieldMask(google___protobuf___message___Message):
37+
class FieldMask(google___protobuf___message___Message, well_known_types.FieldMask):
3638
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
3739
paths: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ...
3840

third_party/2and3/google/protobuf/struct_pb2.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ from google.protobuf.message import (
1818
Message as google___protobuf___message___Message,
1919
)
2020

21+
from google.protobuf.internal import well_known_types
22+
2123
from typing import (
2224
Iterable as typing___Iterable,
2325
Mapping as typing___Mapping,
@@ -50,7 +52,7 @@ class _NullValue(google___protobuf___internal___enum_type_wrapper____EnumTypeWra
5052
NULL_VALUE = typing___cast(NullValueValue, 0)
5153
type___NullValue = NullValue
5254

53-
class Struct(google___protobuf___message___Message):
55+
class Struct(google___protobuf___message___Message, well_known_types.Struct):
5456
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
5557
class FieldsEntry(google___protobuf___message___Message):
5658
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
@@ -106,7 +108,7 @@ class Value(google___protobuf___message___Message):
106108
def WhichOneof(self, oneof_group: typing_extensions___Literal[u"kind",b"kind"]) -> typing_extensions___Literal["null_value","number_value","string_value","bool_value","struct_value","list_value"]: ...
107109
type___Value = Value
108110

109-
class ListValue(google___protobuf___message___Message):
111+
class ListValue(google___protobuf___message___Message, well_known_types.ListValue):
110112
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
111113

112114
@property

third_party/2and3/google/protobuf/timestamp_pb2.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ from google.protobuf.message import (
99
Message as google___protobuf___message___Message,
1010
)
1111

12+
from google.protobuf.internal import well_known_types
13+
1214
from typing import (
1315
Optional as typing___Optional,
1416
)
@@ -26,7 +28,7 @@ builtin___int = int
2628

2729
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
2830

29-
class Timestamp(google___protobuf___message___Message):
31+
class Timestamp(google___protobuf___message___Message, well_known_types.Timestamp):
3032
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
3133
seconds: builtin___int = ...
3234
nanos: builtin___int = ...

0 commit comments

Comments
 (0)