Skip to content

Commit

Permalink
fix_linting_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinL committed Apr 5, 2024
1 parent 77a4b16 commit 0bb321d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/autoruff.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: autoruff
name: Lint with ruff
on:
pull_request:
branches:
Expand Down
2 changes: 1 addition & 1 deletion splink/linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def _populate_probability_two_random_records_match_from_trained_values(self):
),
)
for em_training_session in self._em_training_sessions:
training_lambda = em_training_session.core_model_settings.probability_two_random_records_match
training_lambda = em_training_session.core_model_settings.probability_two_random_records_match # noqa: E501
training_lambda_bf = prob_to_bayes_factor(training_lambda)
reverse_level_infos = (
em_training_session._comparison_levels_to_reverse_blocking_rule
Expand Down
2 changes: 1 addition & 1 deletion splink/postgres/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def columns(self) -> list[InputColumn]:
return [InputColumn(c, sql_dialect="postgres") for c in cols]

def validate(self):
if type(self.physical_name) is not str:
if not isinstance(self.physical_name, str):
raise ValueError(
f"{self.templated_name} is not a string dataframe.\n"
"Postgres Linker requires input data"
Expand Down
2 changes: 1 addition & 1 deletion splink/settings_validation/settings_column_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def find_columns_not_in_input_dfs(
does not apply any cleaning to the input column(s).
"""
# the key to use when producing our warning logs
if type(columns_to_check) == str:
if isinstance(columns_to_check, str):
columns_to_check = {columns_to_check}

return {col for col in columns_to_check if col not in valid_input_dataframe_columns}
Expand Down
2 changes: 1 addition & 1 deletion splink/sqlite/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def columns(self) -> list[InputColumn]:
return [InputColumn(c, sql_dialect="sqlite") for c in cols]

def validate(self):
if type(self.physical_name) is not str:
if not isinstance(self.physical_name, str):
raise ValueError(
f"{self.templated_name} is not a string dataframe.\n"
"SQLite Linker requires input data"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_comparison_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ def test_exact_match_colnames_for_non_exact_matchy_levels(sql_condition, dialect
# _exact_match_colnames should have an error if it is
# not actually an exact match level
with raises(ValueError):
lev._exact_match_colnames
lev._exact_match_colnames # noqa: B018
2 changes: 1 addition & 1 deletion tests/test_input_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_illegal_names_error():
"my test column",
)
for name in odd_but_legal_names:
InputColumn(name).name_l
InputColumn(name).name_l # noqa: B018

# Check some illegal names we want to raise ParserErrors
illegal_names = ('sur "name"', '"sur" name', '"sur" name[0]', "sur \"name\"['lat']")
Expand Down

0 comments on commit 0bb321d

Please sign in to comment.