Skip to content

Commit

Permalink
more error handling for frame files
Browse files Browse the repository at this point in the history
  • Loading branch information
cklunch committed Dec 4, 2024
1 parent 4619bad commit a75fd4a
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 1 deletion.
Binary file modified dist/neonutilities-1.0.1-py3-none-any.whl
Binary file not shown.
Binary file modified dist/neonutilities-1.0.1.tar.gz
Binary file not shown.
14 changes: 13 additions & 1 deletion src/neonutilities/unzip_and_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,19 @@ def stack_frame_files(framefiles, dpid,
fdat = dataset.dataset(source=framefiles, format="csv",
schema=fschema)

fdattab = fdat.to_table()
try:
fdattab = fdat.to_table()
except Exception:
stringschema = unknown_string_schema(fdat.head(num_rows=0).column_names)
if cloud_mode:
fdat = dataset.dataset(source=framebuckets, filesystem=gcs,
format="csv", schema=stringschema)
else:
fdat = dataset.dataset(source=framefiles,
format="csv", schema=stringschema)
fdattab = fdat.to_table()
logging.info("Large file schema did not match expectations; all variable types set to string.")

fpdat = fdattab.to_pandas()

nm = "per_sample"
Expand Down
Binary file removed tests/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit a75fd4a

Please sign in to comment.