10000 Merge pull request #1780 from dhermes/tiny-pylint-cleanup · googleapis/google-cloud-python@22634ab · GitHub
[go: up one dir, main page]

Skip to content

Commit 22634ab

Browse files
committed
Merge pull request #1780 from dhermes/tiny-pylint-cleanup
Small pylint clean-up.
2 parents 02a2361 + 0352542 commit 22634ab

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

gcloud/bigquery/table.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,8 @@ def insert_data(self,
717717

718718
return errors
719719

720-
def upload_from_file(self, # pylint: disable=R0913,R0914
720+
# pylint: disable=too-many-arguments,too-many-locals
721+
def upload_from_file(self,
721722
file_obj,
722723
source_format,
723724
rewind=False,
@@ -890,9 +891,10 @@ def upload_from_file(self, # pylint: disable=R0913,R0914
890891
six.string_types): # pragma: NO COVER Python3
891892
response_content = response_content.decode('utf-8')
892893
return client.job_from_resource(json.loads(response_content))
894+
# pylint: enable=too-many-arguments,too-many-locals
893895

894896

895-
def _configure_job_metadata(metadata, # pylint: disable=R0913
897+
def _configure_job_metadata(metadata, # pylint: disable=too-many-arguments
896898
allow_jagged_rows,
897899
allow_quoted_newlines,
898900
create_disposition,

gcloud/bigquery/test_table.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ def test_upload_from_file_w_bound_client_multipart(self):
14041404
payload_lines = app_msg._payload.rstrip().splitlines()
14051405
self.assertEqual(payload_lines, body_lines)
14061406

1407-
# pylint: disable=R0915
1407+
# pylint: disable=too-many-statements
14081408
def test_upload_from_file_w_explicit_client_resumable(self):
14091409
import json
14101410
from six.moves.http_client import OK
@@ -1490,6 +1490,7 @@ class _UploadConfig(object):
14901490
'bytes 0-%d/%d' % (length - 1, length))
14911491
self.assertEqual(headers['content-length'], '%d' % (length,))
14921492
self.assertEqual(req['body'], BODY)
1493+
# pylint: enable=too-many-statements
14931494

14941495

14951496
class Test_parse_schema_resource(unittest2.TestCase, _SchemaBase):
@@ -1606,7 +1607,7 @@ def __init__(self, project='project', connection=None):
16061607
self.project = project
16071608
self.connection = connection
16081609

1609-
def job_from_resource(self, resource): # pylint: disable=W0613
1610+
def job_from_resource(self, resource): # pylint: disable=unused-argument
16101611
return self._job
16111612

16121613

gcloud/streaming/test_transfer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pylint: disable=C0302
21
import unittest2
32

43

scripts/pylintrc_default

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ load-plugins=pylint.extensions.check_docs
8787
# """Hi everyone"""
8888
# and thus causes subsequent imports to be
8989
# diagnosed as out-of-order.
90+
# - no-name-in-module: Error gives a lot of false positives for names which
91+
# are defined dynamically. Also, any truly missing names
92+
# will be detected by our 100% code coverage.
9093
disable =
9194
maybe-no-member,
9295
no-member,
@@ -95,6 +98,7 @@ disable =
9598
star-args,
9699
redefined-variable-type,
97100
wrong-import-position,
101+
no-name-in-module,
98102

99103

100104
[REPORTS]

scripts/run_pylint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
}
6666
TEST_RC_REPLACEMENTS = {
6767
'FORMAT': {
68-
'max-module-lines': 1700,
68+
'max-module-lines': 1900,
6969
},
7070
}
7171

system_tests/bigtable.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,8 @@ def test_create_table(self):
231231
self.assertEqual(sorted_tables, expected_tables)
232232

233233
def test_rename_table(self):
234-
# pylint: disable=no-name-in-module
235234
from grpc.beta import interfaces
236235
from grpc.framework.interfaces.face import face
237-
# pylint: enable=no-name-in-module
238236

239237
temp_table_id = 'foo-bar-baz-table'
240238
temp_table = Config.CLUSTER.table(temp_table_id)

0 commit comments

Comments
 (0)
0