@@ -654,13 +654,12 @@ def update_datarange_and_stats(self, df, column_name: str):
654654 min_value , max_value = df .compat .minmax (column_name )
655655 if min_value is not None and max_value is not None :
656656 self .value_range = MinMax (min_value , max_value )
657- elif df .compat .is_numeric (column_name ):
657+ elif df .compat .is_numeric (column_name ) or df . compat . is_datetime ( column_name ) :
658658 try :
659659 min_value , max_value = df .compat .minmax (column_name )
660660 if min_value is not None and max_value is not None :
661661 logger .debug (f"Setting value range: MinMax for { column_name } " )
662662 self .value_range = MinMax (min_value , max_value )
663-
664663 results = df .compat .minmax_stats ([column_name ])
665664
666665 logger .debug (f"Setting value stats for { column_name } " )
@@ -796,26 +795,26 @@ def merge(self, other: DataSpecification, strategy: MergeStrategy | None = None)
796795 this_value = getattr (self , key .value )
797796 other_value = getattr (other , key .value )
798797
799- if key == self .Key .representation_type :
800- if hasattr (this_value , "to_python" ):
801- this_value = this_value .to_python ()
802- if hasattr (other_value , "to_python" ):
803- other_value = other_value .to_python ()
804-
805- if this_value is None :
798+ if this_value == other_value :
799+ setattr (ds , key .value , this_value )
800+ elif this_value is None :
806801 setattr (ds , key .value , other_value )
807802 elif other_value is None :
808803 setattr (ds , key .value , this_value )
809- elif this_value == other_value :
810- setattr (ds , key .value , this_value )
811804 else :
805+ if key == self .Key .representation_type :
806+ if hasattr (this_value , "to_python" ):
807+ this_value = this_value .to_python ()
808+ if hasattr (other_value , "to_python" ):
809+ other_value = other_value .to_python ()
810+
812811 try :
813812 if hasattr (this_value , "merge" ):
814813 merged_value = this_value .merge (other_value )
815814 setattr (ds , key .value , merged_value )
816815 return ds
817- except Exception :
818- logger .debug ( "Merge failed: {e}" )
816+ except Exception as e :
817+ logger .warning ( f "Merge failed: { e } " )
819818
820819 if not strategy :
821820 raise ValueError (
0 commit comments