Skip to content

Commit

Permalink
chore: revert datatypes changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Dec 23, 2023
1 parent 147ae87 commit c51dc6e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ibis/backends/base/sqlglot/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,5 +418,26 @@ class OracleType(SqlglotType):
dialect = "oracle"


class SnowflakeType(SqlglotType):
dialect = "snowflake"
default_temporal_scale = 9

@classmethod
def _from_sqlglot_FLOAT(cls) -> dt.Float64:
return dt.Float64(nullable=cls.default_nullable)

@classmethod
def _from_sqlglot_DECIMAL(cls, precision=None, scale=None) -> dt.Decimal:
if scale is None or int(scale.this.this) == 0:
return dt.Int64(nullable=cls.default_nullable)
else:
return super()._from_sqlglot_DECIMAL(precision, scale)

@classmethod
def _from_sqlglot_ARRAY(cls, value_type=None) -> dt.Array:
assert value_type is None
return dt.Array(dt.json, nullable=cls.default_nullable)


class SQLiteType(SqlglotType):
dialect = "sqlite"

0 comments on commit c51dc6e

Please sign in to comment.