Skip to content

Commit

Permalink
refactor(datatypes): remove String parent type from JSON type
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `JSON` is no longer a subtype of `String`
  • Loading branch information
cpcloud committed Feb 6, 2023
1 parent d1e9d11 commit 34f3898
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ibis/expr/datatypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def can_cast_subtype(source: dt.DataType, target: dt.DataType, **kwargs) -> bool
@castable.register(dt.Integer, (dt.Floating, dt.Decimal))
@castable.register(dt.Floating, dt.Decimal)
@castable.register((dt.Date, dt.Timestamp), (dt.Date, dt.Timestamp))
@castable.register(dt.String, dt.JSON)
@castable.register(dt.JSON, dt.String)
def can_cast_any(source: dt.DataType, target: dt.DataType, **kwargs) -> bool:
return True

Expand Down
2 changes: 1 addition & 1 deletion ibis/expr/datatypes/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def _pretty_piece(self) -> str:


@public
class JSON(String):
class JSON(Variadic):
"""JSON values."""

scalar = ir.JSONScalar
Expand Down

0 comments on commit 34f3898

Please sign in to comment.