Skip to content

Commit

Permalink
chore(🦾): bump python ruff 0.4.5 -> 0.8.0 (apache#31001)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Maxime Beauchemin <[email protected]>
  • Loading branch information
3 people authored Nov 25, 2024
1 parent 3aa8f32 commit 1e4098a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ repos:
- id: helm-docs
files: helm
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.0
rev: v0.8.0
hooks:
- id: ruff
args: [ --fix ]
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ skipsdist = true
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
"**/*.ipynb",
".bzr",
".direnv",
".eggs",
Expand Down
2 changes: 1 addition & 1 deletion requirements/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ requests-oauthlib==2.0.0
# via google-auth-oauthlib
rfc3339-validator==0.1.4
# via openapi-schema-validator
ruff==0.4.5
ruff==0.8.0
# via apache-superset
s3transfer==0.10.1
# via boto3
Expand Down
4 changes: 3 additions & 1 deletion superset/extensions/metadb.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ def _set_columns(self) -> None:
primary_keys = [
column for column in list(self._table.primary_key) if column.primary_key
]
if len(primary_keys) == 1 and primary_keys[0].type.python_type == int:
if len(primary_keys) == 1 and isinstance(
primary_keys[0].type.python_type, type(int)
):
self._rowid = primary_keys[0].name

self.columns = {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/sqla_models_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ def _convert_dttm(
columns_by_name,
)

assert type(normalized) == type(result)
assert isinstance(normalized, type(result))

if isinstance(normalized, TextClause):
assert str(normalized) == str(result)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/viz_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_get_df_returns_empty_df(self):
datasource = self.get_datasource_mock()
test_viz = viz.BaseViz(datasource, form_data)
result = test_viz.get_df(query_obj)
assert type(result) == pd.DataFrame
assert isinstance(result, pd.DataFrame)
assert result.empty

def test_get_df_handles_dttm_col(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/dao/key_value_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_create_pickle_entry(
found_entry = (
db.session.query(KeyValueEntry).filter_by(id=created_entry.id).one()
)
assert type(pickle.loads(found_entry.value)) == type(PICKLE_VALUE)
assert isinstance(pickle.loads(found_entry.value), type(PICKLE_VALUE))
assert found_entry.created_by_fk == admin_user.id


Expand Down

0 comments on commit 1e4098a

Please sign in to comment.