Skip to content

Commit

Permalink
chore: include srid in _from_ibis_GeoSpatial
Browse files Browse the repository at this point in the history
  • Loading branch information
ncclementi committed Jul 4, 2024
1 parent 6f1b1a6 commit afa6e59
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ibis/backends/sql/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,14 @@ def _from_ibis_Timestamp(cls, dtype: dt.Timestamp) -> sge.DataType:

@classmethod
def _from_ibis_GeoSpatial(cls, dtype: dt.GeoSpatial):
srid = dtype.srid
expressions = [sge.DataTypeParam(this=sge.Literal.number(srid))]

Check warning on line 383 in ibis/backends/sql/datatypes.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/sql/datatypes.py#L382-L383

Added lines #L382 - L383 were not covered by tests

if (geotype := dtype.geotype) is not None:
return sge.DataType(this=getattr(typecode, geotype.upper()))
return sge.DataType(this=typecode.GEOMETRY)
return sge.DataType(

Check warning on line 386 in ibis/backends/sql/datatypes.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/sql/datatypes.py#L386

Added line #L386 was not covered by tests
this=getattr(typecode, geotype.upper()), expressions=expressions
)
return sge.DataType(this=typecode.GEOMETRY, expressions=expressions)

Check warning on line 389 in ibis/backends/sql/datatypes.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/sql/datatypes.py#L389

Added line #L389 was not covered by tests

_from_ibis_Point = _from_ibis_LineString = _from_ibis_Polygon = (
_from_ibis_MultiLineString
Expand Down

0 comments on commit afa6e59

Please sign in to comment.