Skip to content

Commit c841351

Browse files
committed
feat: linting and formatting changes
1 parent 8fc4843 commit c841351

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

src/firebase_functions/firestore_fn.py

+31-27
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Event(_core.CloudEvent[_core.T]):
8888
_C2 = _typing.Callable[[_E2], None]
8989

9090
AuthType = _typing.Literal["service_account", "api_key", "system",
91-
"unauthenticated", "unknown"]
91+
"unauthenticated", "unknown"]
9292

9393

9494
@_dataclass.dataclass(frozen=True)
@@ -106,10 +106,10 @@ class EventWithAuthContext(Event[_core.T]):
106106

107107

108108
def _firestore_endpoint_handler(
109-
func: _C1 | _C2 | _C3 | _C4,
110-
event_type: str,
111-
document_pattern: _path_pattern.PathPattern,
112-
raw: _ce.CloudEvent,
109+
func: _C1 | _C2 | _C3 | _C4,
110+
event_type: str,
111+
document_pattern: _path_pattern.PathPattern,
112+
raw: _ce.CloudEvent,
113113
) -> None:
114114
event_attributes = raw._get_attributes()
115115
event_data: _typing.Any = raw.get_data()
@@ -190,22 +190,22 @@ def _firestore_endpoint_handler(
190190
}
191191

192192
common_event_kwargs = {
193-
'project': event_project,
194-
'namespace': event_namespace,
195-
'database': event_database,
196-
'location': event_location,
197-
'document': event_document,
198-
'specversion': event_attributes["specversion"],
199-
'id': event_attributes["id"],
200-
'source': event_attributes["source"],
201-
'type': event_attributes["type"],
202-
'time': event_time,
203-
'data': firestore_event_data,
204-
'subject': event_attributes["subject"],
205-
'params': params,
193+
"project": event_project,
194+
"namespace": event_namespace,
195+
"database": event_database,
196+
"location": event_location,
197+
"document": event_document,
198+
"specversion": event_attributes["specversion"],
199+
"id": event_attributes["id"],
200+
"source": event_attributes["source"],
201+
"type": event_attributes["type"],
202+
"time": event_time,
203+
"data": firestore_event_data,
204+
"subject": event_attributes["subject"],
205+
"params": params,
206206
}
207207

208-
if event_type.endswith('.withAuthContext'):
208+
if event_type.endswith(".withAuthContext"):
209209
database_event_with_auth_context = EventWithAuthContext(
210210
**common_event_kwargs,
211211
auth_type=event_auth_type,
@@ -267,10 +267,11 @@ def on_document_written_wrapped(raw: _ce.CloudEvent):
267267

268268
@_util.copy_func_kwargs(FirestoreOptions)
269269
def on_document_written_with_auth_context(**kwargs
270-
) -> _typing.Callable[[_C1], _C1]:
270+
) -> _typing.Callable[[_C1], _C1]:
271271
"""
272272
Event handler that triggers when a document is created, updated, or deleted in Firestore.
273-
This trigger will also provide the authentication context of the principal who triggered the event.
273+
This trigger will also provide the authentication context of the principal who triggered
274+
the event.
274275
275276
Example:
276277
@@ -365,10 +366,11 @@ def on_document_updated_wrapped(raw: _ce.CloudEvent):
365366

366367
@_util.copy_func_kwargs(FirestoreOptions)
367368
def on_document_updated_with_auth_context(**kwargs
368-
) -> _typing.Callable[[_C1], _C1]:
369+
) -> _typing.Callable[[_C1], _C1]:
369370
"""
370371
Event handler that triggers when a document is updated in Firestore.
371-
This trigger will also provide the authentication context of the principal who triggered the event.
372+
This trigger will also provide the authentication context of the principal who triggered
373+
the event.
372374
373375
Example:
374376
@@ -463,10 +465,11 @@ def on_document_created_wrapped(raw: _ce.CloudEvent):
463465

464466
@_util.copy_func_kwargs(FirestoreOptions)
465467
def on_document_created_with_auth_context(**kwargs
466-
) -> _typing.Callable[[_C2], _C2]:
468+
) -> _typing.Callable[[_C2], _C2]:
467469
"""
468470
Event handler that triggers when a document is created in Firestore.
469-
This trigger will also provide the authentication context of the principal who triggered the event.
471+
This trigger will also provide the authentication context of the principal who triggered
472+
the event.
470473
471474
Example:
472475
@@ -561,10 +564,11 @@ def on_document_deleted_wrapped(raw: _ce.CloudEvent):
561564

562565
@_util.copy_func_kwargs(FirestoreOptions)
563566
def on_document_deleted_with_auth_context(**kwargs
564-
) -> _typing.Callable[[_C2], _C2]:
567+
) -> _typing.Callable[[_C2], _C2]:
565568
"""
566569
Event handler that triggers when a document is deleted in Firestore.
567-
This trigger will also provide the authentication context of the principal who triggered the event.
570+
This trigger will also provide the authentication context of the principal who triggered
571+
the event.
568572
569573
Example:
570574

0 commit comments

Comments
 (0)