From bd4ec61f5433d1cd2bc6a72828b9c37a11d20c47 Mon Sep 17 00:00:00 2001 From: Miguel Hernandez Date: Fri, 21 Jan 2022 13:54:43 -0600 Subject: [PATCH] [BEAM-13051] Fixed no-value-for-parameter warning for missing default values --- sdks/python/.pylintrc | 2 ++ sdks/python/apache_beam/io/avroio_test.py | 8 +++++++- sdks/python/apache_beam/io/filesystem.py | 2 +- .../testing/load_tests/load_test_metrics_utils.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sdks/python/.pylintrc b/sdks/python/.pylintrc index a5d8e006c6eb2..bead17d76cd7a 100644 --- a/sdks/python/.pylintrc +++ b/sdks/python/.pylintrc @@ -119,8 +119,10 @@ disable = no-else-raise, no-else-return, no-member, + no-name-in-module, no-self-argument, no-self-use, + no-value-for-parameter, not-callable, pointless-statement, protected-access, diff --git a/sdks/python/apache_beam/io/avroio_test.py b/sdks/python/apache_beam/io/avroio_test.py index 3d0db805cbf29..bcffac528a195 100644 --- a/sdks/python/apache_beam/io/avroio_test.py +++ b/sdks/python/apache_beam/io/avroio_test.py @@ -95,7 +95,13 @@ def tearDown(self): os.remove(path) self._temp_files = [] - def _write_data(self, directory, prefix, codec, count, sync_interval): + def _write_data( + self, + directory=None, + prefix=None, + codec=None, + count=None, + sync_interval=None): raise NotImplementedError def _write_pattern(self, num_files, return_filenames=False): diff --git a/sdks/python/apache_beam/io/filesystem.py b/sdks/python/apache_beam/io/filesystem.py index 92d55929309fe..9820dcc9a5ffe 100644 --- a/sdks/python/apache_beam/io/filesystem.py +++ b/sdks/python/apache_beam/io/filesystem.py @@ -257,7 +257,7 @@ def _read_from_internal_buffer(self, read_fn): self._read_buffer.seek(0, os.SEEK_END) # Allow future writes. return result - def read(self, num_bytes): + def read(self, num_bytes: Optional[int] = None): # type: (int) -> bytes if not self._decompressor: raise ValueError('decompressor not initialized') diff --git a/sdks/python/apache_beam/testing/load_tests/load_test_metrics_utils.py b/sdks/python/apache_beam/testing/load_tests/load_test_metrics_utils.py index 7b975bbe8feb1..3b6ec2e024d2f 100644 --- a/sdks/python/apache_beam/testing/load_tests/load_test_metrics_utils.py +++ b/sdks/python/apache_beam/testing/load_tests/load_test_metrics_utils.py @@ -216,7 +216,7 @@ def __init__( 'InfluxDB') self.filters = filters - def publish_metrics(self, result, extra_metrics: dict): + def publish_metrics(self, result, extra_metrics: Optional[dict] = None): metric_id = uuid.uuid4().hex metrics = result.metrics().query(self.filters)