(self, obj, as_of_date, country_code)
| 1319 | missing.append(obj) |
| 1320 | |
| 1321 | def _lookup_generic_scalar_helper(self, obj, as_of_date, country_code): |
| 1322 | |
| 1323 | if isinstance(obj, (Asset, ContinuousFuture)): |
| 1324 | return obj |
| 1325 | |
| 1326 | if isinstance(obj, Integral): |
| 1327 | try: |
| 1328 | return self.retrieve_asset(int(obj)) |
| 1329 | except SidsNotFound: |
| 1330 | return None |
| 1331 | |
| 1332 | if isinstance(obj, string_types): |
| 1333 | # Try to look up as an equity first. |
| 1334 | try: |
| 1335 | return self.lookup_symbol( |
| 1336 | symbol=obj, |
| 1337 | as_of_date=as_of_date, |
| 1338 | country_code=country_code |
| 1339 | ) |
| 1340 | except SymbolNotFound: |
| 1341 | # Fall back to lookup as a Future |
| 1342 | try: |
| 1343 | # TODO: Support country_code for future_symbols? |
| 1344 | return self.lookup_future_symbol(obj) |
| 1345 | except SymbolNotFound: |
| 1346 | return None |
| 1347 | |
| 1348 | raise NotAssetConvertible("Input was %s, not AssetConvertible." % obj) |
| 1349 | |
| 1350 | def lookup_generic(self, obj, as_of_date, country_code): |
| 1351 | """ |
no test coverage detected