Skip to content

Commit

Permalink
Merge pull request #9 from tejtw/v1.1.1rc4
Browse files Browse the repository at this point in the history
REV: debug for mismatching mdate
  • Loading branch information
Han860207 authored Feb 26, 2024
2 parents 3dd789a + 56cffae commit ee64b10
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions TejToolAPI/TejToolAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ def consecutive_merge(local_var, loop_array):
# Merge tables by dask merge.

temp = local_var[loop_array[i]]
if ('annd' in temp.columns) and ('mdate' not in temp.columns) : # modified 20240223 by Han
temp['mdate'] = temp['annd'].copy()
if (temp['mdate'].dtype != data['mdate'].dtype) :
data['mdate'] = data['mdate'].astype(temp['mdate'].dtype)
# modified 20240226 by Han
d = right_keys[1] # d is date
if temp[d].dtype != data['mdate'].dtype :
data['mdate'] = data['mdate'].astype(temp[d].dtype)

data = dd.merge(data, temp, on = ['coid', 'mdate'] , how = 'left', suffixes = ('','_surfeit'))
data = dd.merge(data, local_var[loop_array[i]], left_on = ['coid', 'mdate'], right_on = right_keys, how = 'left', suffixes = ('','_surfeit'))
# Drop surfeit columns.
data = data.loc[:,~data.columns.str.contains('_surfeit')]
data['mdate'] = data['mdate'].astype('datetime64[ns]')
Expand Down

0 comments on commit ee64b10

Please sign in to comment.