When I create a report on a dataset with geometry column, like from GeoPandas, it will raise a confusing error:
Traceback (most recent call last):
File "/Users/saul/p/property-data/tmp.py", line 15, in <module>
report.to_file("report.html")
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/typeguard/__init__.py", line 1033, in wrapper
retval = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/ydata_profiling/profile_report.py", line 350, in to_file
data = self.to_html()
^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/typeguard/__init__.py", line 1033, in wrapper
retval = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/ydata_profiling/profile_report.py", line 461, in to_html
return self.html
^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/typeguard/__init__.py", line 1033, in wrapper
retval = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/ydata_profiling/profile_report.py", line 272, in html
self._html = self._render_html()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/typeguard/__init__.py", line 1033, in wrapper
retval = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/ydata_profiling/profile_report.py", line 380, in _render_html
report = self.report
^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/typeguard/__init__.py", line 1033, in wrapper
retval = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/ydata_profiling/profile_report.py", line 266, in report
self._report = get_report_structure(self.config, self.description_set)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/ydata_profiling/report/structure/report.py", line 383, in get_report_structure
render_variables_section(config, summary),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/ydata_profiling/report/structure/report.py", line 159, in render_variables_section
template_variables.update(render_map_type(config, template_variables))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/ydata_profiling/report/structure/variables/render_categorical.py", line 340, in render_categorical
template_variables = render_common(config, summary)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Caskroom/miniconda/base/envs/property-data/lib/python3.11/site-packages/ydata_profiling/report/structure/variables/render_common.py", line 20, in render_common
freqtable=summary["value_counts_index_sorted"],
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'value_counts_index_sorted
Expected Behaviour
It's fine that ydata doesn't support geodata, but it would nice to either to drop this column or tell me I should drop it beforehand.
### OS
Mac
### Checklist
- [X] There is not yet another bug report for this issue in the [issue tracker](https://github.com/ydataai/pandas-profiling/issues)
- [X] The problem is reproducible from this bug report. [This guide](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) can help to craft a minimal bug report.
- [X] The issue has not been resolved by the entries listed under [Common Issues](https://pandas-profiling.ydata.ai/docs/master/pages/support_contrib/common_issues.html).
Current Behaviour
When I create a report on a dataset with geometry column, like from GeoPandas, it will raise a confusing error:
Expected Behaviour
It's fine that ydata doesn't support geodata, but it would nice to either to drop this column or tell me I should drop it beforehand.
Data Description
For the reproducible example, I just made some sample data. My data is available here: https://github.com/saulshanabrook/property-data
Code that reproduces the bug
pandas-profiling version
v4.1.1
Dependencies