File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -885,12 +885,15 @@ def sequence_join(
885885 _values = []
886886 for item in value :
887887 if isinstance (item , np .timedelta64 ):
888- # Convert timedelta64 to numeric value in its original unit.
888+ # Convert timedelta64 to numeric value. For generic units, preserve the
889+ # raw integer value; for specific units, convert in that unit.
889890 unit = np .datetime_data (item .dtype )[0 ]
890- # If unit is generic, convert to seconds as a default
891891 if unit == "generic" :
892- unit = "s"
893- _values .append (str (item .astype (f"timedelta64[{ unit } ]" ).astype (int )))
892+ _values .append (str (int (item )))
893+ else :
894+ _values .append (
895+ str (item .astype (f"timedelta64[{ unit } ]" ).astype (int ))
896+ )
894897 elif " " in str (item ):
895898 _values .append (
896899 np .datetime_as_string (np .asarray (item , dtype = "datetime64" ))
You can’t perform that action at this time.
0 commit comments