Skip to content

Commit 24a10d4

Browse files
committed
Use the {} constructor instead of dict()
1 parent 554a82b commit 24a10d4

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

cirro/clients/s3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class S3Client:
3535
def __init__(self, creds_getter: Callable[[], AWSCredentials], checksum_method: str = None):
3636
self._creds_getter = creds_getter
3737
self._client = self._build_session_client()
38-
self._upload_args = dict(ChecksumAlgorithm=checksum_method)
39-
self._download_args = dict(ChecksumMode='ENABLED') if checksum_method else dict()
38+
self._upload_args = {"ChecksumAlgorithm": checksum_method}
39+
self._download_args = {"ChecksumMode": 'ENABLED'} if checksum_method else {}
4040

4141
def get_aws_client(self):
4242
return self._client

cirro/helpers/form.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ class FormBuilder:
1111
def __init__(self):
1212

1313
# Contents will be written out as the form
14-
self.form = dict(
15-
ui=OrderedDict(),
16-
form=OrderedDict(
14+
self.form = {
15+
"ui": OrderedDict(),
16+
"form": OrderedDict(
1717
type="object",
1818
properties=OrderedDict()
1919
)
20-
)
20+
}
2121

2222
# Used to make sure that no keys are repeated
2323
self.used_keys = set()
@@ -28,7 +28,7 @@ def __init__(self):
2828
# Store the params which will be populated either by:
2929
# a) While building the form, the optional `test_value` field will be used
3030
# b) While running non-interactively, it will use the values read from $PW_NOTEBOOK_DATA
31-
self.params = dict()
31+
self.params = {}
3232

3333
def add_param(
3434
self,
@@ -65,7 +65,7 @@ def add_param(
6565
assert type in self.PARAM_TYPES, msg
6666

6767
# Start building the item in the form
68-
item = dict(type=type)
68+
item = {"type": type}
6969

7070
# Populate the test value
7171
if test_value is not None:
@@ -109,11 +109,11 @@ def add_section(self, title: str = None, description: str = None):
109109
self.pointer = section_name
110110

111111
# Add the section
112-
self.form['form']['properties'][section_name] = dict(
113-
title=title,
114-
description=description,
115-
properties=OrderedDict()
116-
)
112+
self.form['form']['properties'][section_name] = {
113+
"title": title,
114+
"description": description,
115+
"properties": OrderedDict()
116+
}
117117

118118
def _new_section_name(self):
119119
"""Internal method to pick a new section name."""

cirro/services/dataset.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,12 @@ def validate_folder(
342342
]
343343
]
344344

345-
return dict(
346-
ds_files_matching=ds_files_matching,
347-
ds_files_notmatching=ds_files_notmatching,
348-
ds_files_missing=ds_files_missing,
349-
local_only_files=local_only_files
350-
)
345+
return {
346+
"ds_files_matching": ds_files_matching,
347+
"ds_files_notmatching": ds_files_notmatching,
348+
"ds_files_missing": ds_files_missing,
349+
"local_only_files": local_only_files
350+
}
351351

352352
def file_is_valid(self, ds_file: File, local_file: Path) -> bool:
353353
try:

0 commit comments

Comments
 (0)