Skip to content

Commit 7748526

Browse files
committed
schema.py: fix some types, remove redundant str
1 parent b2a5a26 commit 7748526

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

schema_salad/schema.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def avro_name(url): # type: (AnyStr) -> AnyStr
392392
return url
393393

394394

395-
Avro = TypeVar('Avro', Dict[six.text_type, Any], List[Any], six.text_type)
395+
Avro = TypeVar('Avro', Dict[Text, Any], List[Any], Text)
396396

397397

398398
def make_valid_avro(items, # type: Avro
@@ -416,7 +416,7 @@ def make_valid_avro(items, # type: Avro
416416
"Named schemas must have a non-empty name: %s" % items)
417417

418418
if items["name"] in found:
419-
return cast(six.text_type, items["name"])
419+
return cast(Text, items["name"])
420420
else:
421421
found.add(items["name"])
422422
for n in ("type", "items", "values", "fields"):
@@ -431,7 +431,7 @@ def make_valid_avro(items, # type: Avro
431431
for i in items:
432432
ret.append(make_valid_avro(i, alltypes, found, union=union)) # type: ignore
433433
return ret
434-
if union and isinstance(items, (str, six.text_type)):
434+
if union and isinstance(items, six.string_types):
435435
if items in alltypes and avro_name(items) not in found:
436436
return cast(Dict, make_valid_avro(alltypes[items], alltypes, found,
437437
union=union))

0 commit comments

Comments
 (0)