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

[BUG] Unexpected error in rendering Lux widget and recommendations when filtering does not produce results #376

Closed
Innko opened this issue May 18, 2021 · 1 comment

Comments

@Innko
Copy link

Innko commented May 18, 2021

Describe the bug
When filtering a dataframe based on row values does not produce results, the following error is thrown:
<user_path>site-packages\IPython\core\formatters.py:918: UserWarning:
Unexpected error in rendering Lux widget and recommendations. Falling back to Pandas display.
Please report the following issue on Github: https://github.com/lux-org/lux/issues

<user_path>site-packages\lux\core\frame.py:609: UserWarning:Traceback (most recent call last):
File "<user_path>site-packages\lux\core\frame.py", line 571, in ipython_display
self.maintain_recs()
File "<user_path>site-packages\lux\core\frame.py", line 428, in maintain_recs
rec_df.show_all_column_vis()
File "<user_path>site-packages\lux\core\frame.py", line 349, in show_all_column_vis
vis = Vis(list(self.columns), self)
File "<user_path>site-packages\lux\vis\Vis.py", line 39, in init
self.refresh_source(self._source)
File "<user_path>site-packages\lux\vis\Vis.py", line 356, in refresh_source
Compiler.compile_vis(ldf, self)
File "<user_path>site-packages\lux\processor\Compiler.py", line 58, in compile_vis
Compiler.populate_data_type_model(ldf, [vis])
File "<user_path>site-packages\lux\processor\Compiler.py", line 176, in populate_data_type_model
clause.data_type = ldf.data_type[clause.attribute]
KeyError: 'CountryCode'

To Reproduce
Please describe the steps needed to reproduce the behavior. For example:

  1. Create a dataframe
    wdi_country_series_df = pd.read_csv('../lux_data/WDICountry-Series.csv')
  2. Filter dataframe
    wdi_country_series_df[wdi_country_series_df['CountryCode'] == 'ARB']
    Country with this country codes does not exists in dataframe, so error appears.

Expected behavior
Produce empty widget, no recommendation.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@dorisjlee
Copy link
Member

Thanks for raising this issue @Innko! I've added a fix to this bug, this will be released along with other changes in our next release! Let us know if you run into any other problems!

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

2 participants