This is an automated email from the ASF dual-hosted git repository. nielsbasjes pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/avro.git
commit 74bd287cff5ac09fd47e67d1d5814f331c52cee6 Author: Niels Basjes <[email protected]> AuthorDate: Fri Feb 17 11:11:42 2023 +0100 AVRO-3715: [Python] Fix lint issues (reformat code). --- lang/py/avro/test/test_compatibility.py | 14 +++++++------- lang/py/avro/test/test_datafile_interop.py | 1 - lang/py/avro/test/test_io.py | 1 - lang/py/avro/test/test_schema.py | 2 +- lang/py/avro/tether/tether_task.py | 2 -- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lang/py/avro/test/test_compatibility.py b/lang/py/avro/test/test_compatibility.py index 3c36b6f84..e9af424e9 100644 --- a/lang/py/avro/test/test_compatibility.py +++ b/lang/py/avro/test/test_compatibility.py @@ -691,7 +691,7 @@ class TestCompatibility(unittest.TestCase): (WITHOUT_NAMESPACE_RECORD, WITH_NAMESPACE_RECORD), ] - for (reader, writer) in compatible_reader_writer_test_cases: + for reader, writer in compatible_reader_writer_test_cases: self.assertTrue(self.are_compatible(reader, writer)) def test_schema_compatibility_fixed_size_mismatch(self): @@ -711,7 +711,7 @@ class TestCompatibility(unittest.TestCase): "/fields/1/type/size", ), ] - for (reader, writer, message, location) in incompatible_fixed_pairs: + for reader, writer, message, location in incompatible_fixed_pairs: result = ReaderWriterCompatibilityChecker().get_compatibility(reader, writer) self.assertIs(result.compatibility, SchemaCompatibilityType.incompatible) self.assertIn( @@ -737,7 +737,7 @@ class TestCompatibility(unittest.TestCase): "/fields/0/type/symbols", ), ] - for (reader, writer, message, location) in incompatible_pairs: + for reader, writer, message, location in incompatible_pairs: result = ReaderWriterCompatibilityChecker().get_compatibility(reader, writer) self.assertIs(result.compatibility, SchemaCompatibilityType.incompatible) self.assertIn(message, result.messages) @@ -853,7 +853,7 @@ class TestCompatibility(unittest.TestCase): ), ] - for (reader, writer, message, location) in incompatible_pairs: + for reader, writer, message, location in incompatible_pairs: result = ReaderWriterCompatibilityChecker().get_compatibility(reader, writer) self.assertIs(result.compatibility, SchemaCompatibilityType.incompatible) self.assertEqual(result.messages, message) @@ -872,7 +872,7 @@ class TestCompatibility(unittest.TestCase): ), ] - for (reader, writer, message, location) in incompatible_pairs: + for reader, writer, message, location in incompatible_pairs: result = ReaderWriterCompatibilityChecker().get_compatibility(reader, writer) self.assertIs(result.compatibility, SchemaCompatibilityType.incompatible) self.assertIn(message, result.messages) @@ -883,7 +883,7 @@ class TestCompatibility(unittest.TestCase): (A_INT_RECORD1, EMPTY_RECORD1, "a", "/fields/0"), (A_INT_B_DINT_RECORD1, EMPTY_RECORD1, "a", "/fields/0"), ] - for (reader, writer, message, location) in incompatible_pairs: + for reader, writer, message, location in incompatible_pairs: result = ReaderWriterCompatibilityChecker().get_compatibility(reader, writer) self.assertIs(result.compatibility, SchemaCompatibilityType.incompatible) self.assertEqual(len(result.messages), 1) @@ -1063,7 +1063,7 @@ class TestCompatibility(unittest.TestCase): "/", ), ] - for (reader, writer, message, location) in incompatible_pairs: + for reader, writer, message, location in incompatible_pairs: result = ReaderWriterCompatibilityChecker().get_compatibility(reader, writer) self.assertIs(result.compatibility, SchemaCompatibilityType.incompatible) self.assertIn(message, result.messages) diff --git a/lang/py/avro/test/test_datafile_interop.py b/lang/py/avro/test/test_datafile_interop.py index d9e4c690d..7dec16e78 100644 --- a/lang/py/avro/test/test_datafile_interop.py +++ b/lang/py/avro/test/test_datafile_interop.py @@ -42,7 +42,6 @@ class TestDataFileInterop(unittest.TestCase): continue i = None with self.subTest(filename=filename), avro.datafile.DataFileReader(filename.open("rb"), avro.io.DatumReader()) as dfr: - user_metadata = dfr.get_meta("user_metadata") if user_metadata is not None: self.assertEqual(user_metadata, b"someByteArray") diff --git a/lang/py/avro/test/test_io.py b/lang/py/avro/test/test_io.py index 29dd82130..8c92af0fa 100644 --- a/lang/py/avro/test/test_io.py +++ b/lang/py/avro/test/test_io.py @@ -450,7 +450,6 @@ class DefaultValueTestCase(unittest.TestCase): class TestIncompatibleSchemaReading(unittest.TestCase): def test_deserialization_fails(self) -> None: - reader_schema = avro.schema.parse( json.dumps( { diff --git a/lang/py/avro/test/test_schema.py b/lang/py/avro/test/test_schema.py index 8286567f9..c59ded8a7 100644 --- a/lang/py/avro/test/test_schema.py +++ b/lang/py/avro/test/test_schema.py @@ -662,7 +662,7 @@ class SchemaParseTestCase(unittest.TestCase): try: warnings.filterwarnings(action="error", category=avro.errors.IgnoredLogicalType) self.test_schema.parse() - except (avro.errors.IgnoredLogicalType) as e: + except avro.errors.IgnoredLogicalType as e: self.assertIn(type(e), (type(w) for w in test_warnings)) self.assertIn(str(e), (str(w) for w in test_warnings)) except (avro.errors.AvroException, avro.errors.SchemaParseException): # pragma: no coverage diff --git a/lang/py/avro/tether/tether_task.py b/lang/py/avro/tether/tether_task.py index dc138d07d..c521fa56b 100644 --- a/lang/py/avro/tether/tether_task.py +++ b/lang/py/avro/tether/tether_task.py @@ -300,7 +300,6 @@ class TetherTask(abc.ABC): self._red_fkeys = [f.name for f in self.midschema.fields if not (f.order == "ignore")] except Exception as e: - estr = traceback.format_exc() self.fail(estr) @@ -335,7 +334,6 @@ class TetherTask(abc.ABC): self.map(inRecord, self.midCollector) elif self.taskType == TaskType.REDUCE: - # store the previous record prev = self.midRecord
