Skip to content

Commit

Permalink
Start removing type:ingore comments from SA2.0 PR
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Apr 12, 2024
1 parent 14ec017 commit 82a0ef4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions lib/galaxy/managers/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ def update_broadcasted_notification(self, notification_id: int, request: Notific
def get_user_notification_preferences(self, user: User) -> UserNotificationPreferences:
"""Gets the user's current notification preferences or the default ones if no preferences are set."""
current_notification_preferences = (
user.preferences[NOTIFICATION_PREFERENCES_SECTION_NAME] # type:ignore[index]
if NOTIFICATION_PREFERENCES_SECTION_NAME in user.preferences # type:ignore[operator]
user.preferences[NOTIFICATION_PREFERENCES_SECTION_NAME]
if NOTIFICATION_PREFERENCES_SECTION_NAME in user.preferences
else None
)
try:
Expand All @@ -291,9 +291,7 @@ def update_user_notification_preferences(
"""Updates the user's notification preferences with the requested changes."""
notification_preferences = self.get_user_notification_preferences(user)
notification_preferences.update(request.preferences)
user.preferences[NOTIFICATION_PREFERENCES_SECTION_NAME] = (
notification_preferences.model_dump_json()
) # type:ignore[index]
user.preferences[NOTIFICATION_PREFERENCES_SECTION_NAME] = notification_preferences.model_dump_json()
with transaction(self.sa_session):
self.sa_session.commit()
return notification_preferences
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/managers/sharable.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def share_with(self, item, user: User, flush: bool = True):
"""
# precondition: user has been validated
# get or create
existing = self.get_share_assocs(item, user=user) # type:ignore[dict-item]
existing = self.get_share_assocs(item, user=user)
if existing:
return existing.pop(0)
return self._create_user_share_assoc(item, user, flush=flush)
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/workflow/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -2516,13 +2516,13 @@ def inject(self, step: WorkflowStep, step_args=None, steps=None, **kwargs):
If step_args is provided from a web form this is applied to generate
'state' else it is just obtained from the database.
"""
step.upgrade_messages = {} # type: ignore[assignment]
step.upgrade_messages = {}

# Make connection information available on each step by input name.
step.setup_input_connections_by_name()

# Populate module.
module = step.module = module_factory.from_workflow_step(self.trans, step, **kwargs) # type: ignore[assignment]
module = step.module = module_factory.from_workflow_step(self.trans, step, **kwargs)

# Any connected input needs to have value DummyDataset (these
# are not persisted so we need to do it every time)
Expand Down

0 comments on commit 82a0ef4

Please sign in to comment.