Skip to content

Commit 0bd7d0c

Browse files
committed
blacken
1 parent fead994 commit 0bd7d0c

16 files changed

Lines changed: 301 additions & 304 deletions

File tree

google/cloud/firestore_v1/order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TypeOrder(Enum):
3232

3333
@staticmethod
3434
def from_value(value):
35-
#return TypeOrder.OBJECT
35+
# return TypeOrder.OBJECT
3636
v = value._pb.WhichOneof("value_type")
3737

3838
lut = {

google/cloud/firestore_v1/query.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,7 @@ def _normalize_projection(projection):
605605
fields = list(projection.fields)
606606

607607
if not fields:
608-
field_ref = query.StructuredQuery.FieldReference(
609-
field_path="__name__"
610-
)
608+
field_ref = query.StructuredQuery.FieldReference(field_path="__name__")
611609
return query.StructuredQuery.Projection(fields=[field_ref])
612610

613611
return projection

google/cloud/firestore_v1/types/document.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ class Value(proto.Message):
128128
A map value.
129129
"""
130130

131-
null_value = proto.Field(proto.ENUM, number=11, enum=struct.NullValue, oneof="value_type")
131+
null_value = proto.Field(
132+
proto.ENUM, number=11, enum=struct.NullValue, oneof="value_type"
133+
)
132134
boolean_value = proto.Field(proto.BOOL, number=1, oneof="value_type")
133135
integer_value = proto.Field(proto.INT64, number=2, oneof="value_type")
134136
double_value = proto.Field(proto.DOUBLE, number=3, oneof="value_type")
@@ -138,9 +140,15 @@ class Value(proto.Message):
138140
string_value = proto.Field(proto.STRING, number=17, oneof="value_type")
139141
bytes_value = proto.Field(proto.BYTES, number=18, oneof="value_type")
140142
reference_value = proto.Field(proto.STRING, number=5, oneof="value_type")
141-
geo_point_value = proto.Field(proto.MESSAGE, number=8, message=latlng.LatLng, oneof="value_type")
142-
array_value = proto.Field(proto.MESSAGE, number=9, message="ArrayValue", oneof="value_type")
143-
map_value = proto.Field(proto.MESSAGE, number=6, message="MapValue", oneof="value_type")
143+
geo_point_value = proto.Field(
144+
proto.MESSAGE, number=8, message=latlng.LatLng, oneof="value_type"
145+
)
146+
array_value = proto.Field(
147+
proto.MESSAGE, number=9, message="ArrayValue", oneof="value_type"
148+
)
149+
map_value = proto.Field(
150+
proto.MESSAGE, number=6, message="MapValue", oneof="value_type"
151+
)
144152

145153

146154
class ArrayValue(proto.Message):

google/cloud/firestore_v1beta1/_helpers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,7 @@ def make_array_value(values):
513513
)
514514
)
515515
if exists is not None:
516-
transform_pb.current_document.CopyFrom(
517-
common.Precondition(exists=exists)
518-
)
516+
transform_pb.current_document.CopyFrom(common.Precondition(exists=exists))
519517

520518
return transform_pb
521519

google/cloud/firestore_v1beta1/query.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,7 @@ def _normalize_projection(projection):
576576
fields = list(projection.fields)
577577

578578
if not fields:
579-
field_ref = query.StructuredQuery.FieldReference(
580-
field_path="__name__"
581-
)
579+
field_ref = query.StructuredQuery.FieldReference(field_path="__name__")
582580
return query.StructuredQuery.Projection(fields=[field_ref])
583581

584582
return projection
@@ -679,9 +677,7 @@ def _to_protobuf(self):
679677
query_kwargs = {
680678
"select": projection,
681679
"from_": [
682-
query.StructuredQuery.CollectionSelector(
683-
collection_id=self._parent.id
684-
)
680+
query.StructuredQuery.CollectionSelector(collection_id=self._parent.id)
685681
],
686682
"where": self._filters_pb(),
687683
"order_by": orders,

google/cloud/firestore_v1beta1/types/document.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ class Value(proto.Message):
128128
A map value.
129129
"""
130130

131-
null_value = proto.Field(proto.ENUM, number=11, enum=struct.NullValue, oneof="value_type")
131+
null_value = proto.Field(
132+
proto.ENUM, number=11, enum=struct.NullValue, oneof="value_type"
133+
)
132134
boolean_value = proto.Field(proto.BOOL, number=1, oneof="value_type")
133135
integer_value = proto.Field(proto.INT64, number=2, oneof="value_type")
134136
double_value = proto.Field(proto.DOUBLE, number=3, oneof="value_type")
@@ -138,9 +140,15 @@ class Value(proto.Message):
138140
string_value = proto.Field(proto.STRING, number=17, oneof="value_type")
139141
bytes_value = proto.Field(proto.BYTES, number=18, oneof="value_type")
140142
reference_value = proto.Field(proto.STRING, number=5, oneof="value_type")
141-
geo_point_value = proto.Field(proto.MESSAGE, number=8, message=latlng.LatLng, oneof="value_type")
142-
array_value = proto.Field(proto.MESSAGE, number=9, message="ArrayValue", oneof="value_type")
143-
map_value = proto.Field(proto.MESSAGE, number=6, message="MapValue", oneof="value_type")
143+
geo_point_value = proto.Field(
144+
proto.MESSAGE, number=8, message=latlng.LatLng, oneof="value_type"
145+
)
146+
array_value = proto.Field(
147+
proto.MESSAGE, number=9, message="ArrayValue", oneof="value_type"
148+
)
149+
map_value = proto.Field(
150+
proto.MESSAGE, number=6, message="MapValue", oneof="value_type"
151+
)
144152

145153

146154
class ArrayValue(proto.Message):

google/cloud/firestore_v1beta1/watch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def _on_snapshot_target_change_no_change(self, proto):
371371

372372
no_target_ids = change.target_ids is None or len(change.target_ids) == 0
373373
if no_target_ids and change.read_time and self.current:
374-
# TargetChange.TargetChangeType.CURRENT followed by
374+
# TargetChange.TargetChangeType.CURRENT followed by
375375
# TargetChange.TargetChangeType.NO_CHANGE
376376
# signals a consistent state. Invoke the onSnapshot
377377
# callback as specified by the user.

tests/unit/v1/test__helpers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,7 @@ def test_map(self):
464464

465465
sub_value1 = _value_pb(integer_value=187680)
466466
sub_value2 = _value_pb(string_value=u"how low can you go?")
467-
map_pb = document.MapValue(
468-
fields={"first": sub_value1, "second": sub_value2}
469-
)
467+
map_pb = document.MapValue(fields={"first": sub_value1, "second": sub_value2})
470468
value = _value_pb(map_value=map_pb)
471469

472470
expected = {

tests/unit/v1/test_query.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import six
2121

2222

23-
2423
class TestQuery(unittest.TestCase):
2524

2625
if six.PY2:
@@ -256,8 +255,7 @@ def _where_unary_helper(self, value, op_enum, op_string="=="):
256255

257256
field_pb = new_query._field_filters[0]
258257
expected_pb = StructuredQuery.UnaryFilter(
259-
field=StructuredQuery.FieldReference(field_path=field_path),
260-
op=op_enum,
258+
field=StructuredQuery.FieldReference(field_path=field_path), op=op_enum,
261259
)
262260
self.assertEqual(field_pb, expected_pb)
263261
self._compare_queries(query, new_query, "_field_filters")
@@ -994,9 +992,7 @@ def test__to_protobuf_start_at_only(self):
994992
query.StructuredQuery.CollectionSelector(collection_id=parent.id)
995993
],
996994
"order_by": [_make_order_pb("X.Y", StructuredQuery.Direction.ASCENDING)],
997-
"start_at": query.Cursor(
998-
values=[document.Value(string_value=u"Z")]
999-
),
995+
"start_at": query.Cursor(values=[document.Value(string_value=u"Z")]),
1000996
}
1001997
expected_pb = query.StructuredQuery(**query_kwargs)
1002998
self.assertEqual(structured_query_pb, expected_pb)
@@ -1733,9 +1729,7 @@ def _make_query_response(**kwargs):
17331729
name = kwargs.pop("name", None)
17341730
data = kwargs.pop("data", None)
17351731
if name is not None and data is not None:
1736-
document_pb = document.Document(
1737-
name=name, fields=_helpers.encode_dict(data)
1738-
)
1732+
document_pb = document.Document(name=name, fields=_helpers.encode_dict(data))
17391733
delta = datetime.timedelta(seconds=100)
17401734
update_time = _datetime_to_pb_timestamp(now - delta)
17411735
create_time = _datetime_to_pb_timestamp(now - 2 * delta)

0 commit comments

Comments
 (0)