Skip to content

Commit 667cb06

Browse files
committed
check endswith[] first
1 parent ed2015c commit 667cb06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tifeatures/dbmodel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ def json_type(self) -> str:
1818
"""Return JSON field type."""
1919
pgtype = self.type
2020

21+
if pgtype.endswith("[]"):
22+
return "array"
23+
2124
if any(
2225
[
2326
pgtype.startswith("int"),
@@ -30,9 +33,6 @@ def json_type(self) -> str:
3033
if pgtype.startswith("bool"):
3134
return "boolean"
3235

33-
if pgtype.endswith("[]"):
34-
return "array"
35-
3636
if any([pgtype.startswith("json"), pgtype.startswith("geo")]):
3737
return "object"
3838

0 commit comments

Comments
 (0)