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

KeyError: '_cli_extra' #392

Closed
nsheff opened this issue Aug 14, 2023 · 2 comments
Closed

KeyError: '_cli_extra' #392

nsheff opened this issue Aug 14, 2023 · 2 comments

Comments

@nsheff
Copy link
Contributor

nsheff commented Aug 14, 2023

Getting this error on an example for the dna methylation pipelines. I'm trying to track down the source now...

looper run examples/test_config.yaml
The Looper config specification through the PEP project is deprecated and will be removed in future versions. Please use the new running method by utilizing a looper config file. For more information: here is more information 
Config file does not have version key. Defaulting to 2.1.0
Looper version: 1.5.2-dev
Command: run
Using default config. No config found in env var: ['DIVCFG']
Config file does not have version key. Defaulting to 2.1.0
Not all environment variables were populated in derived attribute source: $CODE/microtest/data/{filename}
Not all environment variables were populated in derived attribute source: $CODE/microtest/data/{filename}
Not all environment variables were populated in derived attribute source: $CODE/microtest/data/{filename}
Not all environment variables were populated in derived attribute source: $CODE/microtest/data/{filename}
Traceback (most recent call last):
  File "/home/nsheff/.local/bin/looper", line 8, in <module>
    sys.exit(main())
  File "/home/nsheff/.local/lib/python3.8/site-packages/looper/looper.py", line 1125, in main
    p = Project(
  File "/home/nsheff/.local/lib/python3.8/site-packages/looper/project.py", line 118, in __init__
    setattr(self[EXTRA_KEY], attr_name, kwargs[attr_name])
  File "/home/nsheff/.local/lib/python3.8/site-packages/peppy/project.py", line 1365, in __getitem__
    return self._project_data[item]
KeyError: '_cli_extra'
@nsheff
Copy link
Contributor Author

nsheff commented Aug 14, 2023

This is the error given when you have

pipeline_interfaces:
  sample: null

so I think it's an error message issue.

@donaldcampbelljr
Copy link
Contributor

Tried to replicate this but get a reasonable error message:

Looper finished
Samples valid for job generation: 0 of 2
Commands submitted: 0 of 0
Jobs submitted: 0

1 unique reasons for submission failure: No pipeline interfaces defined

Summary of failures:
No pipeline interfaces defined: frog_1, frog_2
{'Pipestat compatible': False, 'Commands submitted': '0 of 0', 'Jobs submitted': 0, 
'No pipeline interfaces defined': 'frog_2'}

And it appears that self[EXTRA_KEY] will now exist as an empty dict, so it should not give a key error later in the code:

looper/looper/project.py

Lines 117 to 126 in 519a2db

self[EXTRA_KEY] = {}
# add sample pipeline interface to the project
if kwargs.get(SAMPLE_PL_ARG):
self.set_sample_piface(kwargs.get(SAMPLE_PL_ARG))
for attr_name in CLI_PROJ_ATTRS:
if attr_name in kwargs:
self[EXTRA_KEY][attr_name] = kwargs[attr_name]
# setattr(self[EXTRA_KEY], attr_name, kwargs[attr_name])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants