File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ def convert_sf_to_sp_type(
307307 if column_type_name == "REAL" :
308308 return DoubleType ()
309309 if (column_type_name == "FIXED" or column_type_name == "NUMBER" ) and scale == 0 :
310- return LongType (precision = precision )
310+ return LongType (_precision = precision )
311311 raise NotImplementedError (
312312 "Unsupported type: {}, precision: {}, scale: {}" .format (
313313 column_type_name , precision , scale
Original file line number Diff line number Diff line change @@ -371,15 +371,23 @@ def _fill_ast(self, ast: proto.DataType) -> None:
371371# Numeric types
372372class _IntegralType (_NumericType ):
373373 def __init__ (self , ** kwargs ) -> None :
374- self ._precision = kwargs .get ("precision" , None )
374+ self ._precision = kwargs .get ("_precision" , None )
375+
376+ if kwargs :
377+ raise TypeError (
378+ f"{ self .__class__ .__name__ } () does not accept any arguments, please construct it without parameters."
379+ )
375380
376381 def __eq__ (self , other ):
377382 def filtered (d : dict ) -> dict :
378383 return {k : v for k , v in d .items () if k != "_precision" }
379384
380- return isinstance (other , self .__class__ ) and filtered (
381- self .__dict__
382- ) == filtered (other .__dict__ )
385+ if context ._is_snowpark_connect_compatible_mode :
386+ return isinstance (other , self .__class__ ) and self .__dict__ == other .__dict__
387+ else :
388+ return isinstance (other , self .__class__ ) and filtered (
389+ self .__dict__
390+ ) == filtered (other .__dict__ )
383391
384392 def __hash__ (self ):
385393 return hash (repr (self ))
You can’t perform that action at this time.
0 commit comments