Skip to content

BUG: Fix asset writer, memoize cache, and event scheduling bugs#318

Open
pandashark wants to merge 1 commit intostefan-jansen:mainfrom
pandashark:bugfix/asset-utility-fixes
Open

BUG: Fix asset writer, memoize cache, and event scheduling bugs#318
pandashark wants to merge 1 commit intostefan-jansen:mainfrom
pandashark:bugfix/asset-utility-fixes

Conversation

@pandashark
Copy link

Summary

Fixes 5 bugs in asset management, caching, and event scheduling utilities:

  • LRU cache: _weak_lru_cache double-counted misses and cache_clear() crashed trying to subscript integer counters.
  • Iterator exhaustion: _lookup_symbol_strict assigned map() to country_codes, which was consumed by set() and empty when passed to the error constructor.
  • Table check short-circuit: _all_tables_present returned after checking only the first table due to return inside the loop.
  • Calendar comparison: BeforeClose compared a calendar object to the string "us_futures" (always False) instead of comparing self.cal.name.
  • Argument swap: write_direct passed (_futures_defaults, futures) to _generate_output_dataframe which expects (data, defaults).

Closes #315

Test plan

  • Full test suite passes (3142 tests, 11 pre-existing pandas 2.3 failures)
  • flake8 clean on all modified files

Fix _weak_lru_cache double-counting misses and cache_clear() crash
from subscripting integers. Materialize map() iterator to list in
AssetFinder._lookup_symbol_strict to prevent exhaustion. Fix
_all_tables_present to check all tables instead of returning after
the first. Compare self.cal.name instead of self.cal to string in
BeforeClose. Fix write_direct argument order for futures in
AssetDBWriter.

Closes stefan-jansen#315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Bugs in asset writer, LRU cache, symbol lookup, and event scheduling

1 participant