Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lang/py/avro/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Command line utility for reading and writing Avro files."""

import argparse
import csv
import functools
Expand Down
1 change: 0 additions & 1 deletion lang/py/avro/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

"""Contains Constants for Python Avro"""


DATE = "date"
DECIMAL = "decimal"
TIMESTAMP_MICROS = "timestamp-micros"
Expand Down
1 change: 1 addition & 0 deletions lang/py/avro/datafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

https://avro.apache.org/docs/current/spec.html#Object+Container+Files
"""

import io
import json
import warnings
Expand Down
1 change: 1 addition & 0 deletions lang/py/avro/name.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# limitations under the License.

"""Contains the Name classes."""

from typing import TYPE_CHECKING, Dict, Optional

from avro.constants import PRIMITIVE_TYPES
Expand Down
30 changes: 10 additions & 20 deletions lang/py/avro/test/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,7 @@ class TestMisc(unittest.TestCase):

def test_correct_recursive_extraction(self):
"""A recursive reference within a schema should be the same type every time."""
s = avro.schema.parse(
"""{
s = avro.schema.parse("""{
"type": "record",
"name": "X",
"fields": [{
Expand All @@ -756,8 +755,7 @@ def test_correct_recursive_extraction(self):
"name": "Y",
"fields": [{"name": "Z", "type": "X"}]}
}]
}"""
)
}""")
t = avro.schema.parse(str(s.fields[0].type))
# If we've made it this far, the subschema was reasonably stringified; it ccould be reparsed.
self.assertEqual("X", t.fields[0].type.name)
Expand Down Expand Up @@ -1186,12 +1184,10 @@ def test_whitespace(self):
"""
Eliminate all whitespace in JSON outside of string literals.
"""
s = avro.schema.parse(
"""{"type": "fixed",
s = avro.schema.parse("""{"type": "fixed",
"size": 16,
"name": "md5"}
"""
)
""")
self.assertEqual(
s.canonical_form,
self.compact_json_string({"name": "md5", "type": "fixed", "size": 16}),
Expand Down Expand Up @@ -1270,8 +1266,7 @@ def test_union(self):
self.assertEqual(s.canonical_form, '["string","null","long"]')

def test_large_record_handshake_request(self):
s = avro.schema.parse(
"""
s = avro.schema.parse("""
{
"type": "record",
"name": "HandshakeRequest",
Expand All @@ -1289,8 +1284,7 @@ def test_large_record_handshake_request(self):
}
]
}
"""
)
""")
self.assertEqual(
s.canonical_form,
(
Expand All @@ -1303,8 +1297,7 @@ def test_large_record_handshake_request(self):
)

def test_large_record_handshake_response(self):
s = avro.schema.parse(
"""
s = avro.schema.parse("""
{
"type": "record",
"name": "HandshakeResponse",
Expand All @@ -1327,8 +1320,7 @@ def test_large_record_handshake_response(self):
"name": "meta",
"type": ["null", {"type": "map", "values": "bytes"}]}]
}
"""
)
""")
self.assertEqual(
s.canonical_form,
(
Expand All @@ -1343,8 +1335,7 @@ def test_large_record_handshake_response(self):
)

def test_large_record_interop(self):
s = avro.schema.parse(
"""
s = avro.schema.parse("""
{
"type": "record",
"name": "Interop",
Expand Down Expand Up @@ -1391,8 +1382,7 @@ def test_large_record_interop(self):
}
]
}
"""
)
""")
self.assertEqual(
s.canonical_form,
(
Expand Down