Skip to content

Commit 2eccae3

Browse files
committed
Remove None from param types and add (Optional).
This runs a script to remove None from the types for parameters, and added (Optional) to the description. Does not pass lint due to some too-long lines. I will clean those up manually. See: googleapis/google-cloud-python#2580 (review)
1 parent 6f17fa9 commit 2eccae3

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

google/cloud/logging/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def _entry_from_resource(self, resource, loggers):
139139
:type resource: dict
140140
:param resource: one entry resource from API response
141141
142-
:type loggers: dict or None
143-
:param loggers: A mapping of logger fullnames -> loggers. If not
142+
:type loggers: dict
143+
:param loggers: (Optional) A mapping of logger fullnames -> loggers. If not
144144
passed, the entry will have a newly-created logger.
145145
146146
:rtype: One of:

google/cloud/logging/entries.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ class _BaseEntry(object):
5656
:type logger: :class:`google.cloud.logging.logger.Logger`
5757
:param logger: the logger used to write the entry.
5858
59-
:type insert_id: text, or :class:`NoneType`
59+
:type insert_id: text
6060
:param insert_id: (optional) the ID used to identify an entry uniquely.
6161
62-
:type timestamp: :class:`datetime.datetime`, or :class:`NoneType`
62+
:type timestamp: :class:`datetime.datetime`
6363
:param timestamp: (optional) timestamp for the entry
6464
65-
:type labels: dict or :class:`NoneType`
65+
:type labels: dict
6666
:param labels: (optional) mapping of labels for the entry
6767
68-
:type severity: str or :class:`NoneType`
68+
:type severity: str
6969
:param severity: (optional) severity of event being logged.
7070
71-
:type http_request: dict or :class:`NoneType`
71+
:type http_request: dict
7272
:param http_request: (optional) info about HTTP request associated with
7373
the entry
7474
"""
@@ -94,8 +94,8 @@ def from_api_repr(cls, resource, client, loggers=None):
9494
:param client: Client which holds credentials and project
9595
configuration.
9696
97-
:type loggers: dict or None
98-
:param loggers: A mapping of logger fullnames -> loggers. If not
97+
:type loggers: dict
98+
:param loggers: (Optional) A mapping of logger fullnames -> loggers. If not
9999
passed, the entry will have a newly-created logger.
100100
101101
:rtype: :class:`google.cloud.logging.entries.TextEntry`

google/cloud/logging/logger.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Logger(object):
3232
:param client: A client which holds credentials and project configuration
3333
for the logger (which requires a project).
3434
35-
:type labels: dict or :class:`NoneType`
35+
:type labels: dict
3636
:param labels: (optional) mapping of default labels for entries written
3737
via this logger.
3838
"""
@@ -99,25 +99,25 @@ def _make_entry_resource(self, text=None, info=None, message=None,
9999
100100
Only one of ``text``, ``info``, or ``message`` should be passed.
101101
102-
:type text: str or :class:`NoneType`
103-
:param text: text payload
102+
:type text: str
103+
:param text: (Optional) text payload
104104
105-
:type info: dict or :class:`NoneType`
106-
:param info: struct payload
105+
:type info: dict
106+
:param info: (Optional) struct payload
107107
108108
:type message: Protobuf message or :class:`NoneType`
109109
:param message: protobuf payload
110110
111-
:type labels: dict or :class:`NoneType`
112-
:param labels: labels passed in to calling method.
111+
:type labels: dict
112+
:param labels: (Optional) labels passed in to calling method.
113113
114-
:type insert_id: str or :class:`NoneType`
114+
:type insert_id: str
115115
:param insert_id: (optional) unique ID for log entry.
116116
117-
:type severity: str or :class:`NoneType`
117+
:type severity: str
118118
:param severity: (optional) severity of event being logged.
119119
120-
:type http_request: dict or :class:`NoneType`
120+
:type http_request: dict
121121
:param http_request: (optional) info about HTTP request associated with
122122
the entry
123123
@@ -172,16 +172,16 @@ def log_text(self, text, client=None, labels=None, insert_id=None,
172172
:param client: the client to use. If not passed, falls back to the
173173
``client`` stored on the current logger.
174174
175-
:type labels: dict or :class:`NoneType`
175+
:type labels: dict
176176
:param labels: (optional) mapping of labels for the entry.
177177
178-
:type insert_id: str or :class:`NoneType`
178+
:type insert_id: str
179179
:param insert_id: (optional) unique ID for log entry.
180180
181-
:type severity: str or :class:`NoneType`
181+
:type severity: str
182182
:param severity: (optional) severity of event being logged.
183183
184-
:type http_request: dict or :class:`NoneType`
184+
:type http_request: dict
185185
:param http_request: (optional) info about HTTP request associated with
186186
the entry
187187
"""
@@ -206,16 +206,16 @@ def log_struct(self, info, client=None, labels=None, insert_id=None,
206206
:param client: the client to use. If not passed, falls back to the
207207
``client`` stored on the current logger.
208208
209-
:type labels: dict or :class:`NoneType`
209+
:type labels: dict
210210
:param labels: (optional) mapping of labels for the entry.
211211
212-
:type insert_id: str or :class:`NoneType`
212+
:type insert_id: str
213213
:param insert_id: (optional) unique ID for log entry.
214214
215-
:type severity: str or :class:`NoneType`
215+
:type severity: str
216216
:param severity: (optional) severity of event being logged.
217217
218-
:type http_request: dict or :class:`NoneType`
218+
:type http_request: dict
219219
:param http_request: (optional) info about HTTP request associated with
220220
the entry.
221221
"""
@@ -240,16 +240,16 @@ def log_proto(self, message, client=None, labels=None, insert_id=None,
240240
:param client: the client to use. If not passed, falls back to the
241241
``client`` stored on the current logger.
242242
243-
:type labels: dict or :class:`NoneType`
243+
:type labels: dict
244244
:param labels: (optional) mapping of labels for the entry.
245245
246-
:type insert_id: str or :class:`NoneType`
246+
:type insert_id: str
247247
:param insert_id: (optional) unique ID for log entry.
248248
249-
:type severity: str or :class:`NoneType`
249+
:type severity: str
250250
:param severity: (optional) severity of event being logged.
251251
252-
:type http_request: dict or :class:`NoneType`
252+
:type http_request: dict
253253
:param http_request: (optional) info about HTTP request associated with
254254
the entry.
255255
"""
@@ -347,16 +347,16 @@ def log_text(self, text, labels=None, insert_id=None, severity=None,
347347
:type text: str
348348
:param text: the text entry
349349
350-
:type labels: dict or :class:`NoneType`
350+
:type labels: dict
351351
:param labels: (optional) mapping of labels for the entry.
352352
353-
:type insert_id: str or :class:`NoneType`
353+
:type insert_id: str
354354
:param insert_id: (optional) unique ID for log entry.
355355
356-
:type severity: str or :class:`NoneType`
356+
:type severity: str
357357
:param severity: (optional) severity of event being logged.
358358
359-
:type http_request: dict or :class:`NoneType`
359+
:type http_request: dict
360360
:param http_request: (optional) info about HTTP request associated with
361361
the entry.
362362
"""
@@ -370,16 +370,16 @@ def log_struct(self, info, labels=None, insert_id=None, severity=None,
370370
:type info: dict
371371
:param info: the struct entry
372372
373-
:type labels: dict or :class:`NoneType`
373+
:type labels: dict
374374
:param labels: (optional) mapping of labels for the entry.
375375
376-
:type insert_id: str or :class:`NoneType`
376+
:type insert_id: str
377377
:param insert_id: (optional) unique ID for log entry.
378378
379-
:type severity: str or :class:`NoneType`
379+
:type severity: str
380380
:param severity: (optional) severity of event being logged.
381381
382-
:type http_request: dict or :class:`NoneType`
382+
:type http_request: dict
383383
:param http_request: (optional) info about HTTP request associated with
384384
the entry.
385385
"""
@@ -393,16 +393,16 @@ def log_proto(self, message, labels=None, insert_id=None, severity=None,
393393
:type message: protobuf message
394394
:param message: the protobuf entry
395395
396-
:type labels: dict or :class:`NoneType`
396+
:type labels: dict
397397
:param labels: (optional) mapping of labels for the entry.
398398
399-
:type insert_id: str or :class:`NoneType`
399+
:type insert_id: str
400400
:param insert_id: (optional) unique ID for log entry.
401401
402-
:type severity: str or :class:`NoneType`
402+
:type severity: str
403403
:param severity: (optional) severity of event being logged.
404404
405-
:type http_request: dict or :class:`NoneType`
405+
:type http_request: dict
406406
:param http_request: (optional) info about HTTP request associated with
407407
the entry.
408408
"""

0 commit comments

Comments
 (0)