Skip to content

Commit

Permalink
Fix E721 lint errors (#1509)
Browse files Browse the repository at this point in the history
  • Loading branch information
J535D165 committed Aug 10, 2023
1 parent 5358d03 commit 3d8f0ba
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions asreview/state/sqlstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ def get_data_by_query_number(self, query, columns=None):
query number and columns.
"""
if columns is not None:
if not type(columns) == list:
if not isinstance(columns, list):
raise ValueError("The columns argument should be a list.")
col_query_string = "*" if columns is None else ",".join(columns)

Expand Down Expand Up @@ -953,7 +953,7 @@ def get_dataset(self, columns=None, priors=True, pending=False):
Dataframe containing the data of the specified columns of the
results table.
"""
if type(columns) == str:
if isinstance(columns, str):
columns = [columns]

if (not priors) or (not pending):
Expand Down
2 changes: 1 addition & 1 deletion asreview/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _unsafe_dict_update(default_dict, override_dict):
for key in new_dict:
if key in override_dict:
str_val = override_dict[key]
if type(new_dict[key]) == bool:
if isinstance(new_dict[key], bool):
new_dict[key] = str_val in ["True", "true", "T", "t", True]
else:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def test_set_token(setup_teardown):

assert updated_user.token is not None
assert updated_user.token_created_at is not None
assert type(updated_user.token_created_at) == dt
assert isinstance(updated_user.token_created_at, dt)


# verify token validity, by default token is 24 hours valid
Expand Down
2 changes: 1 addition & 1 deletion asreview/webapp/tests/utils/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def create_user(DB, user=1):
if type(user) == int:
if isinstance(user, int):
user = cp.get_user(user)
try:
DB.session.add(user)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ ignore =
W504
# Missing newline between import groups.
I201

exclude =
build/*
doc/build/*.py,
docs/source/conf.py
versioneer.py,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def test_last_ranking(tmpdir):
)

last_ranking = state.get_last_ranking()
assert type(last_ranking) == pd.DataFrame
assert isinstance(last_ranking, pd.DataFrame)
assert list(last_ranking.columns) == [
"record_id",
"ranking",
Expand Down

0 comments on commit 3d8f0ba

Please sign in to comment.