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

fix: More readable error with unsortable index column #1568

Closed
wants to merge 1 commit into from

Conversation

saulshanabrook
Copy link

Fixes #1567 by raising a better error message pointing out when a column has an unsortable index.

@saulshanabrook saulshanabrook changed the title More readable error with unsortable index column fix: More readable error with unsortable index column Mar 29, 2024
Fixes ydataai#1567 by raising a better error message pointing out when a column has an unsortable index.
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 90.18%. Comparing base (28ee3da) to head (efecb13).

Files Patch % Lines
...filing/report/structure/variables/render_common.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1568      +/-   ##
===========================================
- Coverage    90.19%   90.18%   -0.02%     
===========================================
  Files          195      195              
  Lines         6394     6396       +2     
===========================================
+ Hits          5767     5768       +1     
- Misses         627      628       +1     
Flag Coverage Δ
py3.8-ubuntu-22.04-pandas 90.18% <50.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alexbarros
Copy link
Contributor

alexbarros commented Apr 8, 2024

hi @saulshanabrook, I was checking the error, and it seems the confusing message has to do with the profiling version. In the latest version the error is a bit less confusing, it still is a stack trace, but indicates a bit better the cause.
In the end the cause of the error is that ydata-profiling currently fails while trying to infer the geopandas.Point since it is not part of the supported types.
It still able to generate the report if you define the type to categorical using the type_schema parameter and it will display the categorical statistics for the column.

report = ProfileReport(gdf, type_schema={"geometry": "categorical"})

also, since the error is captured early, it don't get to render pipeline to trigger the validation you added. The correct message in this case needs to be added to the type inference (i.e. infer types), and since it depends on a external lib (visions) so the improvement would likely be added to visions instead.

I will be closing both the PR and the linked issue in this case.

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 Report: Confusing Error with Geometry Column
2 participants