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

Rewrite Choice step to make it usable from mlrun #537

Merged
merged 6 commits into from
Oct 15, 2024

Conversation

gtopper
Copy link
Collaborator

@gtopper gtopper commented Sep 15, 2024

Copy link
Member

@guy1992l guy1992l left a comment

Choose a reason for hiding this comment

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

I'm not the person who should review it, but if I may, it looks pretty much straight forward. I had a comment and few suggestions but besides these, A+ :)

self.to(default)
self._default = default
def _init(self, **kwargs):
super()._init()
Copy link
Member

Choose a reason for hiding this comment

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

Just to make sure it is not an error: before the change the kwargs were sent at the Flow init so I would expect to see super().__init__(**kwargs) unless it is redundant. I think the outlets param should be passed here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, the **kwargs need to be removed. There's no kwargs in _init(). Note that _init is unrelated to __init__.

storey/flow.py Outdated
# TODO: hacky way of supporting mlrun preview, which replaces targets with a DFTarget
self._passthrough_for_preview = list(self._name_to_outlet) == ["dataframe"]

def select_outlets(self, event):
Copy link
Member

Choose a reason for hiding this comment

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

I would add a type hint and also in the doc string mention that the selected outlets should be returned in a list of strings - the outlet names.

Suggested change
def select_outlets(self, event):
def select_outlets(self, event) -> List[str]:

Comment on lines +380 to +382
if self._passthrough_for_preview:
outlet = self._name_to_outlet["dataframe"]
outlets.append(outlet)
Copy link
Member

Choose a reason for hiding this comment

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

add a TODO here as well to remember to delete this "hack"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't really want to duplicate the TODO that's already on the attribute definition.

@gtopper gtopper requested a review from guy1992l October 15, 2024 04:43
@gtopper gtopper merged commit c389ddc into mlrun:development Oct 15, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants