@@ -37,7 +37,7 @@ impl From<PyScalarValue> for ScalarValue {
3737}
3838
3939#[ derive( Debug , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
40- #[ pyclass( eq, eq_int, name = "RexType" , module = "datafusion.common" ) ]
40+ #[ pyclass( frozen , eq, eq_int, name = "RexType" , module = "datafusion.common" ) ]
4141pub enum RexType {
4242 Alias ,
4343 Literal ,
@@ -56,6 +56,7 @@ pub enum RexType {
5656/// and manageable location. Therefore this structure exists
5757/// to map those types and provide a simple place for developers
5858/// to map types from one system to another.
59+ // TODO: This looks like this needs pyo3 tracking so leaving unfrozen for now
5960#[ derive( Debug , Clone ) ]
6061#[ pyclass( name = "DataTypeMap" , module = "datafusion.common" , subclass) ]
6162pub struct DataTypeMap {
@@ -577,7 +578,7 @@ impl DataTypeMap {
577578/// Since `DataType` exists in another package we cannot make that happen here so we wrap
578579/// `DataType` as `PyDataType` This exists solely to satisfy those constraints.
579580#[ derive( Debug , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
580- #[ pyclass( name = "DataType" , module = "datafusion.common" ) ]
581+ #[ pyclass( frozen , name = "DataType" , module = "datafusion.common" ) ]
581582pub struct PyDataType {
582583 pub data_type : DataType ,
583584}
@@ -635,7 +636,7 @@ impl From<DataType> for PyDataType {
635636
636637/// Represents the possible Python types that can be mapped to the SQL types
637638#[ derive( Debug , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
638- #[ pyclass( eq, eq_int, name = "PythonType" , module = "datafusion.common" ) ]
639+ #[ pyclass( frozen , eq, eq_int, name = "PythonType" , module = "datafusion.common" ) ]
639640pub enum PythonType {
640641 Array ,
641642 Bool ,
@@ -655,7 +656,7 @@ pub enum PythonType {
655656#[ allow( non_camel_case_types) ]
656657#[ allow( clippy:: upper_case_acronyms) ]
657658#[ derive( Debug , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
658- #[ pyclass( eq, eq_int, name = "SqlType" , module = "datafusion.common" ) ]
659+ #[ pyclass( frozen , eq, eq_int, name = "SqlType" , module = "datafusion.common" ) ]
659660pub enum SqlType {
660661 ANY ,
661662 ARRAY ,
@@ -713,7 +714,13 @@ pub enum SqlType {
713714#[ allow( non_camel_case_types) ]
714715#[ allow( clippy:: upper_case_acronyms) ]
715716#[ derive( Debug , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
716- #[ pyclass( eq, eq_int, name = "NullTreatment" , module = "datafusion.common" ) ]
717+ #[ pyclass(
718+ frozen,
719+ eq,
720+ eq_int,
721+ name = "NullTreatment" ,
722+ module = "datafusion.common"
723+ ) ]
717724pub enum NullTreatment {
718725 IGNORE_NULLS ,
719726 RESPECT_NULLS ,
0 commit comments