Skip to content

Commit

Permalink
list and dict comprehensions
Browse files Browse the repository at this point in the history
  • Loading branch information
atombrella committed Nov 20, 2024
1 parent ce45e5d commit a9eb5bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,14 @@ def arguments_loader(self):

def load_setter_op_arguments(self):
op = self.get_op_handler(self.setter_op_path)
return dict(extract_args_from_signature(op, excluded_params=EXCLUDED_PARAMS))
return {k: v for k, v in extract_args_from_signature(op, excluded_params=EXCLUDED_PARAMS)}

def load_custom_function_op_arguments(self):
if not self.custom_function_op_path:
return {}
op = self.get_op_handler(self.custom_function_op_path)
self.apply_doc_string(op) # pylint: disable=protected-access
return dict(extract_args_from_signature(op, excluded_params=EXCLUDED_PARAMS))
return {k: v for k, v in extract_args_from_signature(op, excluded_params=EXCLUDED_PARAMS)}

def description_loader(self):
""" Callback function of CLICommand description_loader """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def list_share_files(cmd, client, directory_name=None, timeout=None, exclude_dir

if exclude_dir:
t_file_properties = cmd.get_models('_models#FileProperties', resource_type=ResourceType.DATA_STORAGE_FILESHARE)
return list(f for f in results if isinstance(f, t_file_properties))
return [f for f in results if isinstance(f, t_file_properties)]
return results


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _upload_action(src, dst):

return client.make_file_url(destination, dir_name, file_name)

return list(_upload_action(src, dst) for src, dst in source_files)
return [_upload_action(src, dst) for src, dst in source_files]


def storage_file_download_batch(cmd, client, source, destination, pattern=None, dryrun=False, validate_content=False,
Expand Down Expand Up @@ -164,7 +164,7 @@ def _download_action(pair):
client.get_file_to_path(**get_file_args)
return client.make_file_url(source, *pair)

return list(_download_action(f) for f in source_files)
return [_download_action(f) for f in source_files]


def storage_file_copy_batch(cmd, client, source_client, destination_share=None, destination_path=None,
Expand Down

0 comments on commit a9eb5bf

Please sign in to comment.