Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise KeyError(f"None of [{key}] are in the [{axis_name}]") KeyError: "None of [Index(['sender', 'subject'], dtype='object')] are in the [columns]" #47

Open
mutong184 opened this issue Nov 13, 2024 · 0 comments

Comments

@mutong184
Copy link

I find there is a bug
there is a bug:
Traceback (most recent call last):
File "/home/lijiajun/pz/palimpzest/demos/simpleDemo.py", line 564, in
print_table(records, cols=cols, gradio=False, plan_str=plan_str)
File "/home/lijiajun/pz/palimpzest/demos/simpleDemo.py", line 306, in print_table
final_df = records_df[print_cols] if not records_df.empty else pd.DataFrame(columns=print_cols)
~~~~~~~~~~^^^^^^^^^^^^
File "/home/lijiajun/.conda/envs/pz2/lib/python3.12/site-packages/pandas/core/frame.py", line 3899, in getitem
indexer = self.columns._get_indexer_strict(key, "columns")[1]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lijiajun/.conda/envs/pz2/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 6115, in _get_indexer_strict
self._raise_if_missing(keyarr, indexer, axis_name)
File "/home/lijiajun/.conda/envs/pz2/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 6176, in _raise_if_missing
raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['sender', 'subject'], dtype='object')] are in the [columns]"

Solution:
replace the code "records = [{key: record.dict[key] for key in record.dict if not key.startswith("_")} for record in records]" on line 302 of the file "demos/simpleDemo.py" with the new code "records = [{key: record._data[key] for key in record.data if not key.startswith("")} for record in records]"

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

No branches or pull requests

1 participant