Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(🦾): bump python ruff 0.4.5 -> 0.8.0 #31001

Merged
merged 5 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading