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

Parsing problem for an embeded function #136

Open
gordonwatts opened this issue Apr 4, 2024 · 0 comments
Open

Parsing problem for an embeded function #136

gordonwatts opened this issue Apr 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@gordonwatts
Copy link
Member

    query = ds.Select(
        lambda e: {
            "evt": e.EventInfo("EventInfo"),
            "jet": e.Jets("AnalysisJets", calibrate=False),
        }
    ).Select(
        lambda ei: {
            "event_number": ei.evt.eventNumber(),
            "run_number": ei.evt.runNumber(),
            "jet_pt": ei.jet.Select(lambda j: j.pt() / 1000),
        }
    )

Causes this crash:

PS C:\Users\gordo\Code\iris-hep\idap-200gbps-atlas> python .\servicex\servicex_materialize_branches.py
WARNING:root:Fetched the default calibration configuration for a query. It should have been intentionally configured - using configuration for data format PHYS
Traceback (most recent call last):
  File "C:\Users\gordo\Code\iris-hep\idap-200gbps-atlas\servicex\servicex_materialize_branches.py", line 62, in <module>
    main()
  File "C:\Users\gordo\Code\iris-hep\idap-200gbps-atlas\servicex\servicex_materialize_branches.py", line 56, in main
    files = query_servicex()
  File "C:\Users\gordo\Code\iris-hep\idap-200gbps-atlas\servicex\servicex_materialize_branches.py", line 34, in query_servicex
    ).Select(
  File "C:\Users\gordo\Code\iris-hep\idap-200gbps-atlas\.venv\lib\site-packages\func_adl\object_stream.py", line 150, in Select
    self, _local_simplification(parse_as_ast(f, "Select"))
  File "C:\Users\gordo\Code\iris-hep\idap-200gbps-atlas\.venv\lib\site-packages\func_adl\util_ast.py", line 699, in parse_as_ast
    src_ast = _parse_source_for_lambda(ast_source, caller_name)
  File "C:\Users\gordo\Code\iris-hep\idap-200gbps-atlas\.venv\lib\site-packages\func_adl\util_ast.py", line 620, in _parse_source_for_lambda
    lda, saw_new_line = _get_lambda_in_stream(t_stream, start_token)
  File "C:\Users\gordo\Code\iris-hep\idap-200gbps-atlas\.venv\lib\site-packages\func_adl\util_ast.py", line 564, in _get_lambda_in_stream
    function_source = "(" + tokenize.untokenize(accumulated_tokens).lstrip() + ")"
  File "C:\Users\gordo\AppData\Local\Programs\Python\Python310\lib\tokenize.py", line 280, in untokenize
    out = ut.untokenize(iterable)
  File "C:\Users\gordo\AppData\Local\Programs\Python\Python310\lib\tokenize.py", line 203, in untokenize
    indents.pop()
IndexError: pop from empty list
@gordonwatts gordonwatts added the bug Something isn't working label Apr 4, 2024
@gordonwatts gordonwatts self-assigned this Apr 4, 2024
@gordonwatts gordonwatts changed the title Parsing problem for an embaded function Parsing problem for an embeded function Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant