Skip to content

Commit

Permalink
enforce dtypes on events union call
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqshihadah committed Aug 20, 2024
1 parent 6e754a3 commit bf2f646
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions linref/events/union.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ def union(
**{col: arr for col, arr in zip(self.objs[0].keys, keys.T)},
**{self.objs[0].beg: begs, self.objs[0].end: ends},
})
# Enforce dtypes
dtypes = {col: self.objs[0].df.dtypes[col] for col in self.objs[0].keys}
dtypes[self.objs[0].beg] = float
dtypes[self.objs[0].end] = float
data = data.astype(dtypes, copy=False, errors='ignore')

# Merge resegmented data with original dataframe columns
if merge and get_index:
Expand Down

0 comments on commit bf2f646

Please sign in to comment.