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

Return a CSV string representation of input data of type SupportsGeoInterface #3441

Open
mattijn opened this issue Jun 19, 2024 · 0 comments

Comments

@mattijn
Copy link
Contributor

mattijn commented Jun 19, 2024

What is your suggestion?

The _data_to_csv_string function returns a NotImplementedError for objects that adhere to the type SupportsGeoInterface:

altair/altair/utils/data.py

Lines 284 to 291 in 596b282

def _data_to_csv_string(data: Union[dict, pd.DataFrame, DataFrameLike]) -> str:
"""return a CSV string representation of the input data"""
check_data_type(data)
if hasattr(data, "__geo_interface__"):
raise NotImplementedError(
"to_csv does not work with data that "
"contains the __geo_interface__ attribute"
)

The current error states:

to_csv does not work with data that contains the __geo_interface__ attribute.

This is too strong as it is in fact:

to_csv does not yet work with data that is of type SupportsGeoInterface.

Serialization to csv is just not done yet.

Have you considered any alternative solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant