File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 7
7
import numpy as np
8
8
9
9
10
- def get_keys_from_config (common_id_keys , config ) :
10
+ def get_keys_from_config (common_id_keys : dict , config : dict ) -> dict :
11
11
"""Gather keys for a new DataID from the ones available in configured dataset."""
12
12
id_keys = {}
13
13
for key , val in common_id_keys .items ():
14
- if key in config :
15
- id_keys [ key ] = val
16
- elif val is not None and ( val . get ( "required" ) is True or val . get ( "default" ) is not None ) :
14
+ has_key = key in config
15
+ is_required_or_default = val is not None and ( val . get ( "required" ) is True or val . get ( "default" ) is not None )
16
+ if has_key or is_required_or_default :
17
17
id_keys [key ] = val
18
18
if not id_keys :
19
19
raise ValueError ("Metadata does not contain enough information to create a DataID." )
You can’t perform that action at this time.
0 commit comments