Skip to content

fix: issue with empty big_endian array#1420

Merged
ianna merged 2 commits intomainfrom
pfackeldey/fix_writing_issue_with_empties
Apr 22, 2025
Merged

fix: issue with empty big_endian array#1420
ianna merged 2 commits intomainfrom
pfackeldey/fix_writing_issue_with_empties

Conversation

@pfackeldey
Copy link
Copy Markdown
Collaborator

@pfackeldey pfackeldey commented Apr 17, 2025

Fixes problem with 0-length arrays and writing, e.g.:

import uproot

events = uproot.dask({"coffea/tests/samples/nano_dy.root": "Events"})

uproot.dask_write(
  events[events.nJet > 10],  # cuts away all events
  destination="skimtest/",
  prefix="nano_dy/skimmed",
  compute=True,
)

@pfackeldey
Copy link
Copy Markdown
Collaborator Author

@ariostas do you have an idea what's wrong with the pyodide build?

@ariostas
Copy link
Copy Markdown
Member

do you have an idea what's wrong with the pyodide build?

I'm not sure. I'll see if something broke upstream

Copy link
Copy Markdown
Member

@ariostas ariostas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Copy Markdown
Member

@ianna ianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfackeldey - Thanks for fixing this!

@ianna
Copy link
Copy Markdown
Member

ianna commented Apr 18, 2025

Hmm… it’s a decompression failure:

=================================== FAILURES ===================================
________________________ test_read_rntuple_http[chrome] ________________________


>   arrays = obj.arrays()


tests-wasm/test_1272_basic_functionality.py:131: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/lib/python3.12/site-packages/uproot/behaviors/RNTuple.py:641: in arrays
    ???
/lib/python3.12/site-packages/uproot/behaviors/RNTuple.py:438: in num_entries
    ???
/lib/python3.12/site-packages/uproot/models/RNTuple.py:319: in cluster_summaries
    ???
/lib/python3.12/site-packages/uproot/models/RNTuple.py:362: in page_list_envelopes
    ???
/lib/python3.12/site-packages/uproot/models/RNTuple.py:303: in footer
    ???
/lib/python3.12/site-packages/uproot/models/RNTuple.py:201: in header
    ???
/lib/python3.12/site-packages/uproot/models/RNTuple.py:160: in _prepare_header_chunk
    ???
/lib/python3.12/site-packages/uproot/compression.py:463: in decompress
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   cramjam.DecompressionError: incomplete frame


/lib/python3.12/site-packages/uproot/compression.py:309: DecompressionError
----------------------------- Captured stdout call -----------------------------

@ariostas
Copy link
Copy Markdown
Member

Hmm… it’s a decompression failure:

This is fixed in #1422. An update in Chrome broke something

@ianna ianna merged commit dfe90d8 into main Apr 22, 2025
26 checks passed
@ianna ianna deleted the pfackeldey/fix_writing_issue_with_empties branch April 22, 2025 06:00
pfackeldey added a commit that referenced this pull request Apr 23, 2025
fix issue with empty big_endian array

Co-authored-by: Ianna Osborne <ianna.osborne@cern.ch>
ianna added a commit that referenced this pull request Oct 28, 2025
* add tree to virtual array conversion

* chore: update pre-commit hooks (#1418)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.4 → v0.11.5](astral-sh/ruff-pre-commit@v0.11.4...v0.11.5)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* ci: pin Chrome version for Pyodide tests (#1422)

* Updated Pyodide version

* Pinned chrome version

* Changed chrome version

* Try using node instead of chrome

* Remove chrome-specific setup

* Actually use Node

* Go back to chrome

* chore: update pre-commit hooks (#1423)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.5 → v0.11.6](astral-sh/ruff-pre-commit@v0.11.5...v0.11.6)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix: issue with empty big_endian array (#1420)

fix issue with empty big_endian array

Co-authored-by: Ianna Osborne <ianna.osborne@cern.ch>

* fix: safer branch title access (#1421)

* safer branch title access

* empty str -> None

---------

Co-authored-by: Ianna Osborne <ianna.osborne@cern.ch>

* docs: add contributing guide (#1425)

* docs: add contributing guide

* style: pre-commit fixes

* Update CONTRIBUTING.md

Co-authored-by: Andres Rios Tascon <ariostas@gmail.com>

* Update CONTRIBUTING.md

Co-authored-by: Andres Rios Tascon <ariostas@gmail.com>

* Update CONTRIBUTING.md

Co-authored-by: Andres Rios Tascon <ariostas@gmail.com>

* use pre-commit

* build local documentation howto

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andres Rios Tascon <ariostas@gmail.com>

* improve virtual array loading

* style: pre-commit fixes

* add 'access_log' kwarg

* style: pre-commit fixes

* don't re-define 'Accessed'

* add doc string

* minor doc string fixes

* use form_with_unique_keys from awkward

* rm accidentally committed file...

* refactor virtual buffer loading to better work with form mappings

* require awkward v2.8.2

* merge main

* style: pre-commit fixes

* fix pre-commit

* add virtual kwarg to avoid API sprawl

* satisfy pre-commit

* add special single-branch handling like in .arrays(virtual=False)

* properly forward the recursive function call for single branch cases

* ... also for eager .arrays

* add tests

* pre-commit

* add one test with access_log=None (default)

---------

Co-authored-by: Ianna Osborne <ianna.osborne@cern.ch>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andres Rios Tascon <ariostas@gmail.com>
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.

3 participants