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

[24.1] Fix bad merge conflict resolution #19296

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 3 additions & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2630,7 +2630,9 @@ class PostJobAction(Base, RepresentById):
workflow_step_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step.id"), index=True)
action_type: Mapped[str] = mapped_column(String(255))
output_name: Mapped[Optional[str]] = mapped_column(String(255))
_action_arguments: Mapped[Optional[bytes]] = mapped_column(MutableJSONType)
_action_arguments: Mapped[Optional[Union[bool, Dict[str, Any]]]] = mapped_column(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we can have bool in the database the type checker should complain if you attempt this. Do things fail with

Suggested change
_action_arguments: Mapped[Optional[Union[bool, Dict[str, Any]]]] = mapped_column(
_action_arguments: Mapped[Optional[Dict[str, Any]]] = mapped_column(

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't fail, but at line 2650 we are checking as if it's potentially a bool:

if ... and self._action_arguments is True:

so I suppose a future version of mypy may complain about this.
I think this is correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then in that future version we ignore the type (or migrate the buggy values in the column). We should never ever set booleans in that column, any attempt to do so is a bug.

"action_arguments", MutableJSONType
)
workflow_step: Mapped[Optional["WorkflowStep"]] = relationship(
back_populates="post_job_actions",
primaryjoin=(lambda: WorkflowStep.id == PostJobAction.workflow_step_id),
Expand Down
Loading