@@ -8,6 +8,8 @@ use icechunk::conflicts::{
88use pyo3:: prelude:: * ;
99use serde:: { Deserialize , Serialize } ;
1010
11+ use crate :: impl_pickle;
12+
1113#[ pyclass( name = "ConflictType" , eq) ]
1214#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
1315pub enum PyConflictType {
@@ -62,6 +64,8 @@ impl PyConflictType {
6264 }
6365}
6466
67+ impl_pickle ! ( PyConflictType ) ;
68+
6569#[ pyclass( name = "Conflict" ) ]
6670#[ derive( Debug , Clone , Serialize , Deserialize ) ]
6771pub struct PyConflict {
@@ -84,6 +88,8 @@ impl PyConflict {
8488 }
8589}
8690
91+ impl_pickle ! ( PyConflict ) ;
92+
8793impl From < & Conflict > for PyConflict {
8894 fn from ( conflict : & Conflict ) -> Self {
8995 match conflict {
@@ -148,7 +154,7 @@ impl From<&Conflict> for PyConflict {
148154}
149155
150156#[ pyclass( name = "VersionSelection" , eq) ]
151- #[ derive( Debug , Clone , PartialEq , Eq ) ]
157+ #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
152158pub enum PyVersionSelection {
153159 Fail = 0 ,
154160 UseOurs = 1 ,
@@ -165,6 +171,8 @@ impl From<PyVersionSelection> for VersionSelection {
165171 }
166172}
167173
174+ impl_pickle ! ( PyVersionSelection ) ;
175+
168176#[ pyclass( subclass, name = "ConflictSolver" ) ]
169177#[ derive( Clone ) ]
170178pub struct PyConflictSolver ( Arc < dyn ConflictSolver + Send + Sync > ) ;
@@ -176,7 +184,7 @@ impl<'a> AsRef<dyn ConflictSolver + 'a> for PyConflictSolver {
176184}
177185
178186#[ pyclass( name = "BasicConflictSolver" , extends=PyConflictSolver ) ]
179- #[ derive( Debug , Clone ) ]
187+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
180188pub struct PyBasicConflictSolver ;
181189
182190#[ pymethods]
@@ -199,8 +207,10 @@ impl PyBasicConflictSolver {
199207 }
200208}
201209
210+ impl_pickle ! ( PyBasicConflictSolver ) ;
211+
202212#[ pyclass( name = "ConflictDetector" , extends=PyConflictSolver ) ]
203- #[ derive( Debug , Clone ) ]
213+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
204214pub struct PyConflictDetector ;
205215
206216#[ pymethods]
@@ -210,3 +220,5 @@ impl PyConflictDetector {
210220 ( Self , PyConflictSolver ( Arc :: new ( ConflictDetector ) ) )
211221 }
212222}
223+
224+ impl_pickle ! ( PyConflictDetector ) ;
0 commit comments