Skip to content

Commit

Permalink
Enable ignore-without-code mypy error code
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Sep 25, 2024
1 parent 813ed02 commit 4eab7ad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/celery/base_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class GalaxyTaskBeforeStartUserRateLimitPostgres(GalaxyTaskBeforeStartUserRateLi
We take advantage of efficiencies in its dialect.
"""

def calculate_task_start_time( # type: ignore
def calculate_task_start_time(
self, user_id: int, sa_session: galaxy_scoped_session, task_interval_secs: float, now: datetime.datetime
) -> datetime.datetime:
with transaction(sa_session):
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3338,7 +3338,7 @@ class HDACustom(HDADetailed):
# TODO: Fix this workaround for partial_model not supporting UUID fields for some reason.
# The error otherwise is: `PydanticUserError: 'UuidVersion' cannot annotate 'nullable'.`
# Also ignoring mypy complaints about the type redefinition.
uuid: Optional[UUID4] # type: ignore
uuid: Optional[UUID4] # type: ignore[assignment]

# Add fields that are not part of any view here
visualizations: Annotated[
Expand Down
6 changes: 3 additions & 3 deletions lib/galaxy/webapps/galaxy/api/history_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
List,
Literal,
Optional,
Set,
Union,
)

Expand Down Expand Up @@ -335,11 +336,10 @@ def parse_content_types(types: Union[List[str], str]) -> List[HistoryContentType
def parse_dataset_details(details: Optional[str]):
"""Parses the different values that the `dataset_details` parameter
can have from a string."""
dataset_details = None
if details is not None and details != "all":
dataset_details = set(util.listify(details))
dataset_details: Union[None, Set[str], str] = set(util.listify(details))
else: # either None or 'all'
dataset_details = details # type: ignore
dataset_details = details
return dataset_details


Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[mypy]
enable_error_code = ignore-without-code
plugins = pydantic.mypy
show_error_codes = True
ignore_missing_imports = True
Expand Down

0 comments on commit 4eab7ad

Please sign in to comment.