From 830e4190706d4e1a9b1d484e63a969e79592ae01 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Tue, 17 May 2016 16:09:11 -0400 Subject: [PATCH 1/2] Drop ':undoc-members:' from API docs. --- docs/bigquery-client.rst | 2 -- docs/bigquery-dataset.rst | 1 - docs/bigquery-job.rst | 1 - docs/bigquery-query.rst | 1 - docs/bigquery-table.rst | 1 - docs/bigtable-client.rst | 1 - docs/bigtable-cluster.rst | 1 - docs/bigtable-column-family.rst | 1 - docs/bigtable-row-data.rst | 1 - docs/bigtable-row-filters.rst | 1 - docs/bigtable-row.rst | 1 - docs/bigtable-table.rst | 1 - docs/datastore-batches.rst | 1 - docs/datastore-client.rst | 2 -- docs/datastore-entities.rst | 1 - docs/datastore-helpers.rst | 1 - docs/datastore-keys.rst | 1 - docs/datastore-queries.rst | 1 - docs/datastore-transactions.rst | 1 - docs/dns-changes.rst | 1 - docs/dns-client.rst | 2 -- docs/dns-resource-record-set.rst | 1 - docs/dns-zone.rst | 1 - docs/gcloud-api.rst | 5 ----- docs/happybase-batch.rst | 1 - docs/happybase-connection.rst | 1 - docs/happybase-package.rst | 1 - docs/happybase-pool.rst | 1 - docs/happybase-table.rst | 1 - docs/logging-client.rst | 2 -- docs/logging-entries.rst | 1 - docs/logging-logger.rst | 1 - docs/logging-metric.rst | 1 - docs/logging-sink.rst | 1 - docs/monitoring-client.rst | 2 -- docs/monitoring-label.rst | 1 - docs/monitoring-metric.rst | 1 - docs/monitoring-query.rst | 1 - docs/monitoring-resource.rst | 1 - docs/monitoring-timeseries.rst | 1 - docs/pubsub-client.rst | 2 -- docs/pubsub-iam.rst | 1 - docs/pubsub-message.rst | 1 - docs/pubsub-subscription.rst | 1 - docs/pubsub-topic.rst | 1 - docs/resource-manager-client.rst | 2 -- docs/resource-manager-project.rst | 1 - docs/storage-acl.rst | 1 - docs/storage-batch.rst | 1 - docs/storage-blobs.rst | 1 - docs/storage-buckets.rst | 1 - docs/storage-client.rst | 2 -- 52 files changed, 64 deletions(-) diff --git a/docs/bigquery-client.rst b/docs/bigquery-client.rst index 94c3c4139f6b..2dbb17c02ed9 100644 --- a/docs/bigquery-client.rst +++ b/docs/bigquery-client.rst @@ -3,7 +3,6 @@ BigQuery Client .. automodule:: gcloud.bigquery.client :members: - :undoc-members: :show-inheritance: Connection @@ -11,5 +10,4 @@ Connection .. automodule:: gcloud.bigquery.connection :members: - :undoc-members: :show-inheritance: diff --git a/docs/bigquery-dataset.rst b/docs/bigquery-dataset.rst index 9c00c733866b..7ea68c97c4e8 100644 --- a/docs/bigquery-dataset.rst +++ b/docs/bigquery-dataset.rst @@ -3,5 +3,4 @@ Datasets .. automodule:: gcloud.bigquery.dataset :members: - :undoc-members: :show-inheritance: diff --git a/docs/bigquery-job.rst b/docs/bigquery-job.rst index ce24a0adb01c..3af44e9da0a3 100644 --- a/docs/bigquery-job.rst +++ b/docs/bigquery-job.rst @@ -3,5 +3,4 @@ Jobs .. automodule:: gcloud.bigquery.job :members: - :undoc-members: :show-inheritance: diff --git a/docs/bigquery-query.rst b/docs/bigquery-query.rst index b161c8da0c87..735964725327 100644 --- a/docs/bigquery-query.rst +++ b/docs/bigquery-query.rst @@ -3,5 +3,4 @@ Query .. automodule:: gcloud.bigquery.query :members: - :undoc-members: :show-inheritance: diff --git a/docs/bigquery-table.rst b/docs/bigquery-table.rst index c47a554a6967..63297bb471fd 100644 --- a/docs/bigquery-table.rst +++ b/docs/bigquery-table.rst @@ -3,5 +3,4 @@ Tables .. automodule:: gcloud.bigquery.table :members: - :undoc-members: :show-inheritance: diff --git a/docs/bigtable-client.rst b/docs/bigtable-client.rst index b765144a160d..fb2d9cec88e4 100644 --- a/docs/bigtable-client.rst +++ b/docs/bigtable-client.rst @@ -3,5 +3,4 @@ Client .. automodule:: gcloud.bigtable.client :members: - :undoc-members: :show-inheritance: diff --git a/docs/bigtable-cluster.rst b/docs/bigtable-cluster.rst index 9b88f2059d14..9c5276dc462a 100644 --- a/docs/bigtable-cluster.rst +++ b/docs/bigtable-cluster.rst @@ -3,5 +3,4 @@ Cluster .. automodule:: gcloud.bigtable.cluster :members: - :undoc-members: :show-inheritance: diff --git a/docs/bigtable-column-family.rst b/docs/bigtable-column-family.rst index b51d7a18e4ee..6539e0230d15 100644 --- a/docs/bigtable-column-family.rst +++ b/docs/bigtable-column-family.rst @@ -46,5 +46,4 @@ at the lowest level of the nesting: .. automodule:: gcloud.bigtable.column_family :members: - :undoc-members: :show-inheritance: diff --git a/docs/bigtable-row-data.rst b/docs/bigtable-row-data.rst index 5ec98f932d1d..3564f4e7a4b4 100644 --- a/docs/bigtable-row-data.rst +++ b/docs/bigtable-row-data.rst @@ -3,5 +3,4 @@ Row Data .. automodule:: gcloud.bigtable.row_data :members: - :undoc-members: :show-inheritance: diff --git a/docs/bigtable-row-filters.rst b/docs/bigtable-row-filters.rst index b5e99eab6575..9796a4c27239 100644 --- a/docs/bigtable-row-filters.rst +++ b/docs/bigtable-row-filters.rst @@ -62,7 +62,6 @@ level. For example: .. automodule:: gcloud.bigtable.row_filters :members: - :undoc-members: :show-inheritance: .. _RowFilter definition: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/1ff247c2e3b7cd0a2dd49071b2d95beaf6563092/bigtable-protos/src/main/proto/google/bigtable/v1/bigtable_data.proto#L195 diff --git a/docs/bigtable-row.rst b/docs/bigtable-row.rst index ae9835995bda..afb52f39782b 100644 --- a/docs/bigtable-row.rst +++ b/docs/bigtable-row.rst @@ -3,6 +3,5 @@ Bigtable Row .. automodule:: gcloud.bigtable.row :members: - :undoc-members: :show-inheritance: :inherited-members: diff --git a/docs/bigtable-table.rst b/docs/bigtable-table.rst index 03ca332f9c9a..93704aae5d3a 100644 --- a/docs/bigtable-table.rst +++ b/docs/bigtable-table.rst @@ -3,5 +3,4 @@ Table .. automodule:: gcloud.bigtable.table :members: - :undoc-members: :show-inheritance: diff --git a/docs/datastore-batches.rst b/docs/datastore-batches.rst index 49527a9fe495..bf7d5c4ffbcc 100644 --- a/docs/datastore-batches.rst +++ b/docs/datastore-batches.rst @@ -3,5 +3,4 @@ Batches .. automodule:: gcloud.datastore.batch :members: - :undoc-members: :show-inheritance: diff --git a/docs/datastore-client.rst b/docs/datastore-client.rst index bce60ef5052b..23c489dd11c6 100644 --- a/docs/datastore-client.rst +++ b/docs/datastore-client.rst @@ -3,7 +3,6 @@ Datastore Client .. automodule:: gcloud.datastore.client :members: - :undoc-members: :show-inheritance: Connection @@ -11,5 +10,4 @@ Connection .. automodule:: gcloud.datastore.connection :members: - :undoc-members: :show-inheritance: diff --git a/docs/datastore-entities.rst b/docs/datastore-entities.rst index 119699fcb89e..6e263ceeda0e 100644 --- a/docs/datastore-entities.rst +++ b/docs/datastore-entities.rst @@ -3,5 +3,4 @@ Entities .. automodule:: gcloud.datastore.entity :members: - :undoc-members: :show-inheritance: diff --git a/docs/datastore-helpers.rst b/docs/datastore-helpers.rst index 45b7637dd78c..a70e4d2cf534 100644 --- a/docs/datastore-helpers.rst +++ b/docs/datastore-helpers.rst @@ -3,5 +3,4 @@ Helpers .. automodule:: gcloud.datastore.helpers :members: - :undoc-members: :show-inheritance: diff --git a/docs/datastore-keys.rst b/docs/datastore-keys.rst index 3567201a7101..c202471d252d 100644 --- a/docs/datastore-keys.rst +++ b/docs/datastore-keys.rst @@ -3,5 +3,4 @@ Keys .. automodule:: gcloud.datastore.key :members: - :undoc-members: :show-inheritance: diff --git a/docs/datastore-queries.rst b/docs/datastore-queries.rst index 1babc7c9661a..4ffed79925fa 100644 --- a/docs/datastore-queries.rst +++ b/docs/datastore-queries.rst @@ -3,5 +3,4 @@ Queries .. automodule:: gcloud.datastore.query :members: - :undoc-members: :show-inheritance: diff --git a/docs/datastore-transactions.rst b/docs/datastore-transactions.rst index 305279fe621a..d86d7fd74c71 100644 --- a/docs/datastore-transactions.rst +++ b/docs/datastore-transactions.rst @@ -3,6 +3,5 @@ Transactions .. automodule:: gcloud.datastore.transaction :members: - :undoc-members: :show-inheritance: :inherited-members: diff --git a/docs/dns-changes.rst b/docs/dns-changes.rst index ba3e0f44a414..40dc0dddc257 100644 --- a/docs/dns-changes.rst +++ b/docs/dns-changes.rst @@ -3,5 +3,4 @@ Change Sets .. automodule:: gcloud.dns.changes :members: - :undoc-members: :show-inheritance: diff --git a/docs/dns-client.rst b/docs/dns-client.rst index d6c8ac49ad89..e499c2d0eeff 100644 --- a/docs/dns-client.rst +++ b/docs/dns-client.rst @@ -3,7 +3,6 @@ DNS Client .. automodule:: gcloud.dns.client :members: - :undoc-members: :show-inheritance: Connection @@ -11,5 +10,4 @@ Connection .. automodule:: gcloud.dns.connection :members: - :undoc-members: :show-inheritance: diff --git a/docs/dns-resource-record-set.rst b/docs/dns-resource-record-set.rst index e68df9f58f90..ff46e6c7f1ee 100644 --- a/docs/dns-resource-record-set.rst +++ b/docs/dns-resource-record-set.rst @@ -3,5 +3,4 @@ Resource Record Sets .. automodule:: gcloud.dns.resource_record_set :members: - :undoc-members: :show-inheritance: diff --git a/docs/dns-zone.rst b/docs/dns-zone.rst index 059f535d6356..22cb456b56f6 100644 --- a/docs/dns-zone.rst +++ b/docs/dns-zone.rst @@ -3,5 +3,4 @@ Managed Zones .. automodule:: gcloud.dns.zone :members: - :undoc-members: :show-inheritance: diff --git a/docs/gcloud-api.rst b/docs/gcloud-api.rst index 49f1d443cc2d..7226dd59c3bf 100644 --- a/docs/gcloud-api.rst +++ b/docs/gcloud-api.rst @@ -6,7 +6,6 @@ Base Client .. automodule:: gcloud.client :members: - :undoc-members: :show-inheritance: :inherited-members: @@ -15,7 +14,6 @@ Credentials Helpers .. automodule:: gcloud.credentials :members: - :undoc-members: :show-inheritance: Base Connections @@ -23,7 +21,6 @@ Base Connections .. automodule:: gcloud.connection :members: - :undoc-members: :show-inheritance: Exceptions @@ -31,7 +28,6 @@ Exceptions .. automodule:: gcloud.exceptions :members: - :undoc-members: :show-inheritance: Environment Variables @@ -39,5 +35,4 @@ Environment Variables .. automodule:: gcloud.environment_vars :members: - :undoc-members: :show-inheritance: diff --git a/docs/happybase-batch.rst b/docs/happybase-batch.rst index c1fc86b9d6e0..3b512e2bb347 100644 --- a/docs/happybase-batch.rst +++ b/docs/happybase-batch.rst @@ -3,5 +3,4 @@ HappyBase Batch .. automodule:: gcloud.bigtable.happybase.batch :members: - :undoc-members: :show-inheritance: diff --git a/docs/happybase-connection.rst b/docs/happybase-connection.rst index 01485bbdbde0..700b0b9cfcfa 100644 --- a/docs/happybase-connection.rst +++ b/docs/happybase-connection.rst @@ -3,5 +3,4 @@ HappyBase Connection .. automodule:: gcloud.bigtable.happybase.connection :members: - :undoc-members: :show-inheritance: diff --git a/docs/happybase-package.rst b/docs/happybase-package.rst index 22e6134f0fa5..315ef766f32f 100644 --- a/docs/happybase-package.rst +++ b/docs/happybase-package.rst @@ -3,5 +3,4 @@ HappyBase Package .. automodule:: gcloud.bigtable.happybase.__init__ :members: - :undoc-members: :show-inheritance: diff --git a/docs/happybase-pool.rst b/docs/happybase-pool.rst index 9390fd41c01d..40e44a7def52 100644 --- a/docs/happybase-pool.rst +++ b/docs/happybase-pool.rst @@ -3,5 +3,4 @@ HappyBase Connection Pool .. automodule:: gcloud.bigtable.happybase.pool :members: - :undoc-members: :show-inheritance: diff --git a/docs/happybase-table.rst b/docs/happybase-table.rst index b5f477d8058d..d8f6875eb12c 100644 --- a/docs/happybase-table.rst +++ b/docs/happybase-table.rst @@ -3,5 +3,4 @@ HappyBase Table .. automodule:: gcloud.bigtable.happybase.table :members: - :undoc-members: :show-inheritance: diff --git a/docs/logging-client.rst b/docs/logging-client.rst index 528414e1a2e3..3b7db274a803 100644 --- a/docs/logging-client.rst +++ b/docs/logging-client.rst @@ -3,7 +3,6 @@ Logging Client .. automodule:: gcloud.logging.client :members: - :undoc-members: :show-inheritance: Connection @@ -11,6 +10,5 @@ Connection .. automodule:: gcloud.logging.connection :members: - :undoc-members: :show-inheritance: diff --git a/docs/logging-entries.rst b/docs/logging-entries.rst index a7b96721d30b..a22f6094d927 100644 --- a/docs/logging-entries.rst +++ b/docs/logging-entries.rst @@ -3,6 +3,5 @@ Entries .. automodule:: gcloud.logging.entries :members: - :undoc-members: :show-inheritance: diff --git a/docs/logging-logger.rst b/docs/logging-logger.rst index 8deb9b434534..4a95d01662a7 100644 --- a/docs/logging-logger.rst +++ b/docs/logging-logger.rst @@ -3,6 +3,5 @@ Logger .. automodule:: gcloud.logging.logger :members: - :undoc-members: :show-inheritance: diff --git a/docs/logging-metric.rst b/docs/logging-metric.rst index 343634e8307d..2c49a94049ce 100644 --- a/docs/logging-metric.rst +++ b/docs/logging-metric.rst @@ -3,5 +3,4 @@ Metrics .. automodule:: gcloud.logging.metric :members: - :undoc-members: :show-inheritance: diff --git a/docs/logging-sink.rst b/docs/logging-sink.rst index bbfb62130f27..4e2dd40d44dc 100644 --- a/docs/logging-sink.rst +++ b/docs/logging-sink.rst @@ -3,5 +3,4 @@ Sinks .. automodule:: gcloud.logging.sink :members: - :undoc-members: :show-inheritance: diff --git a/docs/monitoring-client.rst b/docs/monitoring-client.rst index 8083d39d5f4f..abe1bdbac325 100644 --- a/docs/monitoring-client.rst +++ b/docs/monitoring-client.rst @@ -3,7 +3,6 @@ Monitoring Client .. automodule:: gcloud.monitoring.client :members: - :undoc-members: :show-inheritance: Connection @@ -11,6 +10,5 @@ Connection .. automodule:: gcloud.monitoring.connection :members: - :undoc-members: :show-inheritance: diff --git a/docs/monitoring-label.rst b/docs/monitoring-label.rst index 827058c92662..a20d5a741af0 100644 --- a/docs/monitoring-label.rst +++ b/docs/monitoring-label.rst @@ -3,5 +3,4 @@ Label Descriptors .. automodule:: gcloud.monitoring.label :members: - :undoc-members: :show-inheritance: diff --git a/docs/monitoring-metric.rst b/docs/monitoring-metric.rst index 79e608b63932..e1fb979e3d22 100644 --- a/docs/monitoring-metric.rst +++ b/docs/monitoring-metric.rst @@ -3,5 +3,4 @@ Metric Descriptors .. automodule:: gcloud.monitoring.metric :members: - :undoc-members: :show-inheritance: diff --git a/docs/monitoring-query.rst b/docs/monitoring-query.rst index 0a1e64982e48..1da7f7e61fcc 100644 --- a/docs/monitoring-query.rst +++ b/docs/monitoring-query.rst @@ -3,5 +3,4 @@ Time Series Query .. automodule:: gcloud.monitoring.query :members: - :undoc-members: :show-inheritance: diff --git a/docs/monitoring-resource.rst b/docs/monitoring-resource.rst index a4ec09ce98dc..d9750decd1c6 100644 --- a/docs/monitoring-resource.rst +++ b/docs/monitoring-resource.rst @@ -3,5 +3,4 @@ Monitored Resource Descriptors .. automodule:: gcloud.monitoring.resource :members: - :undoc-members: :show-inheritance: diff --git a/docs/monitoring-timeseries.rst b/docs/monitoring-timeseries.rst index 120f7280c885..2d3133e7823a 100644 --- a/docs/monitoring-timeseries.rst +++ b/docs/monitoring-timeseries.rst @@ -3,5 +3,4 @@ Time Series .. automodule:: gcloud.monitoring.timeseries :members: - :undoc-members: :show-inheritance: diff --git a/docs/pubsub-client.rst b/docs/pubsub-client.rst index f8b5dfefa491..858d2b7332b7 100644 --- a/docs/pubsub-client.rst +++ b/docs/pubsub-client.rst @@ -3,7 +3,6 @@ Pub/Sub Client .. automodule:: gcloud.pubsub.client :members: - :undoc-members: :show-inheritance: Connection @@ -11,5 +10,4 @@ Connection .. automodule:: gcloud.pubsub.connection :members: - :undoc-members: :show-inheritance: diff --git a/docs/pubsub-iam.rst b/docs/pubsub-iam.rst index 4fb79d216139..6cdfaf266cf5 100644 --- a/docs/pubsub-iam.rst +++ b/docs/pubsub-iam.rst @@ -4,6 +4,5 @@ IAM Policy .. automodule:: gcloud.pubsub.iam :members: :member-order: bysource - :undoc-members: :show-inheritance: diff --git a/docs/pubsub-message.rst b/docs/pubsub-message.rst index b83a9d77fc5f..3b2561f87b9f 100644 --- a/docs/pubsub-message.rst +++ b/docs/pubsub-message.rst @@ -3,5 +3,4 @@ Message .. automodule:: gcloud.pubsub.message :members: - :undoc-members: :show-inheritance: diff --git a/docs/pubsub-subscription.rst b/docs/pubsub-subscription.rst index 6dda5fbdc593..d92d43e57ad4 100644 --- a/docs/pubsub-subscription.rst +++ b/docs/pubsub-subscription.rst @@ -4,5 +4,4 @@ Subscriptions .. automodule:: gcloud.pubsub.subscription :members: :member-order: bysource - :undoc-members: :show-inheritance: diff --git a/docs/pubsub-topic.rst b/docs/pubsub-topic.rst index 99401f0cfbbe..e2ddc3c04570 100644 --- a/docs/pubsub-topic.rst +++ b/docs/pubsub-topic.rst @@ -4,5 +4,4 @@ Topics .. automodule:: gcloud.pubsub.topic :members: :member-order: bysource - :undoc-members: :show-inheritance: diff --git a/docs/resource-manager-client.rst b/docs/resource-manager-client.rst index eda8e7ac1fb8..4c354b25bec5 100644 --- a/docs/resource-manager-client.rst +++ b/docs/resource-manager-client.rst @@ -7,7 +7,6 @@ Client .. automodule:: gcloud.resource_manager.client :members: - :undoc-members: :show-inheritance: Connection @@ -15,5 +14,4 @@ Connection .. automodule:: gcloud.resource_manager.connection :members: - :undoc-members: :show-inheritance: diff --git a/docs/resource-manager-project.rst b/docs/resource-manager-project.rst index 8b6b93bf133e..eee478c2533f 100644 --- a/docs/resource-manager-project.rst +++ b/docs/resource-manager-project.rst @@ -3,5 +3,4 @@ Projects .. automodule:: gcloud.resource_manager.project :members: - :undoc-members: :show-inheritance: diff --git a/docs/storage-acl.rst b/docs/storage-acl.rst index 79fc6e4d2aea..6c2e60b55042 100644 --- a/docs/storage-acl.rst +++ b/docs/storage-acl.rst @@ -3,5 +3,4 @@ ACL .. automodule:: gcloud.storage.acl :members: - :undoc-members: :show-inheritance: diff --git a/docs/storage-batch.rst b/docs/storage-batch.rst index ceb92da278d9..15d96186975c 100644 --- a/docs/storage-batch.rst +++ b/docs/storage-batch.rst @@ -3,5 +3,4 @@ Batches .. automodule:: gcloud.storage.batch :members: - :undoc-members: :show-inheritance: diff --git a/docs/storage-blobs.rst b/docs/storage-blobs.rst index 384806d6e3d8..e6a157771a1d 100644 --- a/docs/storage-blobs.rst +++ b/docs/storage-blobs.rst @@ -3,5 +3,4 @@ Blobs / Objects .. automodule:: gcloud.storage.blob :members: - :undoc-members: :show-inheritance: diff --git a/docs/storage-buckets.rst b/docs/storage-buckets.rst index 55c19a461b93..44ed1118040d 100644 --- a/docs/storage-buckets.rst +++ b/docs/storage-buckets.rst @@ -3,5 +3,4 @@ Buckets .. automodule:: gcloud.storage.bucket :members: - :undoc-members: :show-inheritance: diff --git a/docs/storage-client.rst b/docs/storage-client.rst index 36eb4a21525d..9fb00e91f92f 100644 --- a/docs/storage-client.rst +++ b/docs/storage-client.rst @@ -3,7 +3,6 @@ Storage Client .. automodule:: gcloud.storage.client :members: - :undoc-members: :show-inheritance: Connection @@ -11,5 +10,4 @@ Connection .. automodule:: gcloud.storage.connection :members: - :undoc-members: :show-inheritance: From 17afa7180f9aa04904bcb208eef7aaecc4f9b580 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Tue, 17 May 2016 16:11:00 -0400 Subject: [PATCH 2/2] Set explicit pattern for 'no-docstring-rgx'. Leaving it unset disabled the 'missing-docstring' check. Add missing docstrings uncovered thereby. Closes #1800. --- gcloud/bigquery/_helpers.py | 12 ++++++++++++ gcloud/bigquery/job.py | 5 +++++ gcloud/bigtable/cluster.py | 4 ++++ gcloud/client.py | 1 + gcloud/datastore/client.py | 1 + scripts/pylintrc_default | 2 +- 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/gcloud/bigquery/_helpers.py b/gcloud/bigquery/_helpers.py index 701aedb4c055..afb4d94682b5 100644 --- a/gcloud/bigquery/_helpers.py +++ b/gcloud/bigquery/_helpers.py @@ -18,31 +18,37 @@ def _not_null(value, field): + """Check whether 'value' should be coerced to 'field' type.""" return value is not None or field.mode != 'NULLABLE' def _int_from_json(value, field): + """Coerce 'value' to an int, if set or not nullable.""" if _not_null(value, field): return int(value) def _float_from_json(value, field): + """Coerce 'value' to a float, if set or not nullable.""" if _not_null(value, field): return float(value) def _bool_from_json(value, field): + """Coerce 'value' to a bool, if set or not nullable.""" if _not_null(value, field): return value.lower() in ['t', 'true', '1'] def _datetime_from_json(value, field): + """Coerce 'value' to a datetime, if set or not nullable.""" if _not_null(value, field): # value will be a float in seconds, to microsecond precision, in UTC. return _datetime_from_microseconds(1e6 * float(value)) def _record_from_json(value, field): + """Coerce 'value' to a mapping, if set or not nullable.""" if _not_null(value, field): record = {} for subfield, cell in zip(field.fields, value['f']): @@ -56,6 +62,7 @@ def _record_from_json(value, field): def _string_from_json(value, _): + """NOOP string -> string coercion""" return value @@ -70,6 +77,7 @@ def _string_from_json(value, _): def _rows_from_json(rows, schema): + """Convert JSON row data to rows w/ appropriate types.""" rows_data = [] for row in rows: row_data = [] @@ -132,6 +140,10 @@ def __init__(self, name, property_type): self.property_type = property_type def _validate(self, value): + """Ensure that 'value' is of the appropriate type. + + :raises: ValueError on a type mismatch. + """ if not isinstance(value, self.property_type): raise ValueError('Required type: %s' % (self.property_type,)) diff --git a/gcloud/bigquery/job.py b/gcloud/bigquery/job.py index dfcac73edd33..db62a7ab389f 100644 --- a/gcloud/bigquery/job.py +++ b/gcloud/bigquery/job.py @@ -933,6 +933,11 @@ def __init__(self, name, query, client): """ def _destination_table_resource(self): + """Create a JSON resource for the destination table. + + Helper for :meth:`_populate_config_resource` and + :meth:`_scrub_local_properties` + """ if self.destination is not None: return { 'projectId': self.destination.project, diff --git a/gcloud/bigtable/cluster.py b/gcloud/bigtable/cluster.py index 95be153ad474..55e7a49b446d 100644 --- a/gcloud/bigtable/cluster.py +++ b/gcloud/bigtable/cluster.py @@ -241,6 +241,10 @@ def table(self, table_id): return Table(table_id, self) def _update_from_pb(self, cluster_pb): + """Refresh self from the server-provided protobuf. + + Helper for :meth:`from_pb` and :meth:`reload`. + """ if not cluster_pb.display_name: # Simple field (string) raise ValueError('Cluster protobuf does not contain display_name') if not cluster_pb.serve_nodes: # Simple field (int32) diff --git a/gcloud/client.py b/gcloud/client.py index ac14e85de705..a3bc021c411d 100644 --- a/gcloud/client.py +++ b/gcloud/client.py @@ -150,6 +150,7 @@ def __init__(self, project=None): @staticmethod def _determine_default(project): + """Helper: use default project detection.""" return _determine_default_project(project) diff --git a/gcloud/datastore/client.py b/gcloud/datastore/client.py index 1e9b40d6a8bf..cc92b53a0950 100644 --- a/gcloud/datastore/client.py +++ b/gcloud/datastore/client.py @@ -174,6 +174,7 @@ def __init__(self, project=None, namespace=None, @staticmethod def _determine_default(project): + """Helper: override default project detection.""" return _determine_default_project(project) def _push_batch(self, batch): diff --git a/scripts/pylintrc_default b/scripts/pylintrc_default index bd0ec61e315e..e68626855dc3 100644 --- a/scripts/pylintrc_default +++ b/scripts/pylintrc_default @@ -299,7 +299,7 @@ method-rgx=[a-z_][a-z0-9_]{2,35}$ # Regular expression which should only match function or class names that do # not require a docstring. -# DEFAULT: no-docstring-rgx=__.*__ +no-docstring-rgx=__.*__ # Minimum line length for functions/classes that require docstrings, shorter # ones are exempt.