@@ -220,9 +220,29 @@ def _from_sqlglot_VARCHAR(
220
220
nullable = nullable ,
221
221
)
222
222
223
- _from_sqlglot_NVARCHAR = _from_sqlglot_NCHAR = _from_sqlglot_CHAR = (
224
- _from_sqlglot_FIXEDSTRING
225
- ) = _from_sqlglot_VARCHAR
223
+ @classmethod
224
+ def _from_sqlglot_NVARCHAR (
225
+ cls , length : sge .DataTypeParam | None = None , nullable : bool | None = None
226
+ ) -> dt .String :
227
+ return cls ._from_sqlglot_VARCHAR (length , nullable = nullable )
228
+
229
+ @classmethod
230
+ def _from_sqlglot_NCHAR (
231
+ cls , length : sge .DataTypeParam | None = None , nullable : bool | None = None
232
+ ) -> dt .String :
233
+ return cls ._from_sqlglot_VARCHAR (length , nullable = nullable )
234
+
235
+ @classmethod
236
+ def _from_sqlglot_CHAR (
237
+ cls , length : sge .DataTypeParam | None = None , nullable : bool | None = None
238
+ ) -> dt .String :
239
+ return cls ._from_sqlglot_VARCHAR (length , nullable = nullable )
240
+
241
+ @classmethod
242
+ def _from_sqlglot_FIXEDSTRING (
243
+ cls , length : sge .DataTypeParam | None = None , nullable : bool | None = None
244
+ ) -> dt .String :
245
+ return cls ._from_sqlglot_VARCHAR (length , nullable = nullable )
226
246
227
247
@classmethod
228
248
def _from_sqlglot_MAP (
@@ -466,6 +486,10 @@ def _from_ibis_SpecificGeometry(cls, dtype: dt.GeoSpatial):
466
486
this = getattr (typecode , dtype .geotype .upper ())
467
487
return sge .DataType (this = this , expressions = expressions )
468
488
489
+ # warning: this does early binding, so if you call eg `PostgresType._from_ibis_Point`
490
+ # this will resolve to `SqlglotType._from_ibis_SpecificGeometry`, not
491
+ # `PostgresType._from_ibis_SpecificGeometry`.
492
+ # At this point, not a problem, but be careful if you override this in subclasses.
469
493
_from_ibis_Point = _from_ibis_LineString = _from_ibis_Polygon = (
470
494
_from_ibis_MultiLineString
471
495
) = _from_ibis_MultiPoint = _from_ibis_MultiPolygon = _from_ibis_SpecificGeometry
0 commit comments