Skip to content
Merged
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
9 changes: 3 additions & 6 deletions src/py_avro_schema/_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,9 @@ def _wrap_as_record(self, inner_schema: JSONObj, names: NamesType) -> JSONType:
Handles deduplication via ``names``.
"""
record_name = _avro_name_for_type(_type_from_annotated(self.py_type))
fullname = f"{self.namespace}.{record_name}" if self.namespace else record_name
if fullname in names:
return fullname
names.append(fullname)
if record_name in names:
return record_name
names.append(record_name)
record_schema = {
"type": "record",
"name": record_name,
Expand All @@ -333,8 +332,6 @@ def _wrap_as_record(self, inner_schema: JSONObj, names: NamesType) -> JSONType:
{"name": REF_DATA_KEY, "type": inner_schema},
],
}
if self.namespace:
record_schema["namespace"] = self.namespace
return record_schema


Expand Down