Skip to content

Commit

Permalink
docs: add docstring for SequenceSchema.make_default (jpmorganchase#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
dada-engineer committed Mar 18, 2024
1 parent 6267bb6 commit 90c9bc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/py_avro_schema/_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,11 @@ def data(self, names: NamesType) -> JSONObj:
"items": self.items_schema.data(names=names),
}

def make_default(self, py_default: Any) -> Any:
def make_default(self, py_default: collections.abc.Sequence) -> collections.abc.Sequence:
"""Return an Avro schema compliant default value for a given Python Sequence
:param py_default: The Python sequence to generate a default value for.
"""
origin = get_origin(self.py_type) or self.py_type
return origin(self.items_schema.make_default(item) for item in py_default)

Expand Down

0 comments on commit 90c9bc6

Please sign in to comment.