@@ -189,7 +189,10 @@ def get_rates(self, rate, quote, bases, dts):
189189 if rate == DEFAULT_FX_RATE :
190190 rate = self ._default_rate
191191
192- self ._check_dts (self .dts , dts )
192+ # TODO: Commenting this _check_dts out for now to bypass the
193+ # estimates loader date bounds issue. Will need to address
194+ # this before finalizing anything.
195+ # self._check_dts(self.dts, dts)
193196
194197 row_ixs = self .dts .searchsorted (dts , side = 'right' ) - 1
195198 col_ixs = self .currencies .get_indexer (bases )
@@ -212,7 +215,7 @@ def get_rates(self, rate, quote, bases, dts):
212215 # array, so it's easier to pull all columns and reindex in memory. For
213216 # rows, however, a quick and easy optimization is to pull just the
214217 # slice from min(row_ixs) to max(row_ixs).
215- min_row = row_ixs [0 ]
218+ min_row = max ( row_ixs [0 ], 0 )
216219 max_row = row_ixs [- 1 ]
217220 rows = dataset [min_row :max_row + 1 ] # +1 to be inclusive of end
218221
@@ -221,6 +224,11 @@ def get_rates(self, rate, quote, bases, dts):
221224 # get_indexer returns -1 for failed lookups. Fill these in with NaN.
222225 out [:, col_ixs == - 1 ] = np .nan
223226
227+ # TODO: searchsorted also gives -1 for failed lookups. However, these
228+ # failed lookups arise due to the estimates date bounds bug that we
229+ # have not yet addressed, so this is a temporary fix.
230+ out [row_ixs == - 1 , :] = np .nan
231+
224232 return out
225233
226234 def _check_dts (self , stored , requested ):
0 commit comments