-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide arrow schema on HiPSCat catalog creation (#383)
* Include the arrow schema in catalog operations * Resolve circular import issue * Allow schema to be provided in from_dataframe * Remove filtering of columns from arrow schema
- Loading branch information
1 parent
28375b7
commit efdd685
Showing
15 changed files
with
168 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from __future__ import annotations | ||
|
||
import dask.dataframe as dd | ||
import pyarrow as pa | ||
|
||
|
||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"catalog_name": "small_sky", | ||
"catalog_type": "object", | ||
"total_rows": 131, | ||
"epoch": "J2000", | ||
"ra_column": "ra", | ||
"dec_column": "dec" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Norder,Npix,Dir | ||
0,11,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"catalog_name": "small_sky", | ||
"catalog_type": "object", | ||
"total_rows": 131, | ||
"epoch": "J2000", | ||
"ra_column": "ra", | ||
"dec_column": "dec", | ||
"version": "0.2.7.dev15+g85ec4a0", | ||
"generation_date": "2024.03.06", | ||
"tool_args": { | ||
"tool_name": "hipscat_import", | ||
"version": "0.2.5.dev5+g0733afb", | ||
"runtime_args": { | ||
"catalog_name": "small_sky", | ||
"output_path": ".", | ||
"output_artifact_name": "small_sky", | ||
"tmp_dir": "/tmp/user/11115/tmphywoxno9", | ||
"overwrite": true, | ||
"dask_tmp": "", | ||
"dask_n_workers": 1, | ||
"dask_threads_per_worker": 1, | ||
"catalog_path": "./small_sky", | ||
"tmp_path": "/tmp/user/11115/tmphywoxno9/small_sky/intermediate", | ||
"epoch": "J2000", | ||
"catalog_type": "object", | ||
"input_path": null, | ||
"input_paths": [ | ||
"small_sky_order1/small_sky_order1.csv" | ||
], | ||
"input_file_list": [ | ||
"small_sky_order1/small_sky_order1.csv" | ||
], | ||
"ra_column": "ra", | ||
"dec_column": "dec", | ||
"use_hipscat_index": false, | ||
"sort_columns": null, | ||
"constant_healpix_order": -1, | ||
"highest_healpix_order": 7, | ||
"pixel_threshold": 1000000, | ||
"mapping_healpix_order": 7, | ||
"debug_stats_only": false, | ||
"file_reader_info": { | ||
"input_reader_type": "CsvReader", | ||
"chunksize": 500000, | ||
"header": "infer", | ||
"schema_file": null, | ||
"separator": ",", | ||
"column_names": null, | ||
"type_map": {} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.