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

Generate catalog schema for joining/crossmatching #390

Open
camposandro opened this issue Jul 31, 2024 · 0 comments
Open

Generate catalog schema for joining/crossmatching #390

camposandro opened this issue Jul 31, 2024 · 0 comments

Comments

@camposandro
Copy link
Collaborator

We currently infer the schema for catalogs that result from joining and crossmatching operations. For that we provide the following helper method with the resulting Dask DataFrame's meta. While Pandas does a good job getting the schema right, we should generate it manually to minimize the risk of introducing an incorrect schema. Relates to #383.

def get_arrow_schema(ddf: dd.DataFrame) -> pa.Schema:
"""Constructs the pyarrow schema from the meta of a Dask DataFrame.
Args:
ddf (dd.DataFrame): A Dask DataFrame.
Returns:
The arrow schema for the provided Dask DataFrame.
"""
# pylint: disable=protected-access
return pa.Schema.from_pandas(ddf._meta)

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

No branches or pull requests

1 participant