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

NanoEventsFactory.from_parquet triggers a TypeError in delayed mode when events is called #1010

Open
NJManganelli opened this issue Jan 24, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@NJManganelli
Copy link
Collaborator

Describe the bug
calling events() on NanoEventsFactory.from_parquet(filename, delayed=False) works okay, but with `delayed=True,' it triggers an unexpected code path/error:

To Reproduce

# with coffea.__version__ == '2024.1.2'
import coffea
from coffea.nanoevents import NanoEventsFactory, NanoAODSchema
fname = "/afs/cern.ch/user/n/nmangane/public/part00.parquet"
pqe = NanoEventsFactory.from_parquet(fname, delayed=False)
pqe.events().fields
#output:['FatJet', 'L1Reco', 'SoftActivityJetHT5', 'SoftActivityJetHT10', 'Flag', 'LHEPart', 'SoftActivityJetNjets10', 'OtherPV', 'luminosityBlock', 'Jet', 'genWeight', 'PSWeight', 'fixedGridRhoFastjetCentralCalo', 'GenMET', 'HTXS', 'GenDressedLepton', 'SoftActivityJetNjets2', 'PV', 'SV', 'Muon', 'SoftActivityJetHT', 'fixedGridRhoFastjetCentralNeutral', 'L1simulation', 'PuppiMET', 'btagWeight', 'genTtbarId', 'GenJetAK8', 'HLTriggerFinalPath', 'DeepMETResponseTune', 'FsrPhoton', 'fixedGridRhoFastjetCentral', 'fixedGridRhoFastjetAll', 'Pileup', 'SoftActivityJetNjets5', 'LHEReweightingWeight', 'HLTriggerFirstPath', 'LHEPdfWeight', 'HLT', 'Generator', 'GenPart', 'RawMET', 'RawPuppiMET', 'Photon', 'MET', 'event', 'fixedGridRhoFastjetCentralChargedPileUp', 'CorrT1METJet', 'DeepMETResolutionTune', 'Tau', 'CaloMET', 'LHEScaleWeight', 'run', 'ChsMET', 'GenJet', 'LHEWeight', 'SoftActivityJetHT2', 'GenIsolatedPhoton', 'TkMET', 'GenVisTau', 'Electron', 'SoftActivityJet', 'LHE']
pqd = NanoEventsFactory.from_parquet(fname, delayed=True)
pqd.events()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/srv/.env/lib/python3.11/site-packages/coffea/nanoevents/factory.py", line 674, in events
    events = self._mapping(form_mapping=self._schema)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: from_parquet() got an unexpected keyword argument 'form_mapping'

Expected behavior
Produced form_mapped dask-awkward array

@NJManganelli NJManganelli added the bug Something isn't working label Jan 24, 2024
@lgray
Copy link
Collaborator

lgray commented Jan 24, 2024

This is not yet supported in coffea 2023. Form remapping needs to be implemented for dak.from_parquet. Only root input is available at present in delayed mode.

@NJManganelli NJManganelli added enhancement New feature or request and removed bug Something isn't working labels Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants