mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-17 08:00:13 +01:00
fix: correct DataFrame column filtering and enhance debug output
- Fix KeyError in generate_theme_catalog.py: use isCommander column correctly - DataFrame.get() doesn't work like dict.get() - use column name directly - Enhanced debug step to print full row data for better diagnostics
This commit is contained in:
parent
a689400c47
commit
29b5da4778
2 changed files with 23 additions and 21 deletions
|
|
@ -247,9 +247,13 @@ def build_theme_catalog(
|
|||
all_cards_parquet, theme_variants=theme_variants
|
||||
)
|
||||
|
||||
# For commander counts, filter all_cards by is_commander column
|
||||
# For commander counts, filter all_cards by isCommander column
|
||||
df_commanders = pd.read_parquet(all_cards_parquet)
|
||||
df_commanders = df_commanders[df_commanders.get('is_commander', False)]
|
||||
if 'isCommander' in df_commanders.columns:
|
||||
df_commanders = df_commanders[df_commanders['isCommander']]
|
||||
else:
|
||||
# Fallback: assume all cards could be commanders if column missing
|
||||
pass
|
||||
commander_counts = Counter()
|
||||
for tags in df_commanders['themeTags'].tolist():
|
||||
if tags is None or (isinstance(tags, float) and pd.isna(tags)):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue