这是indexloc提供的服务,不要输入任何密码
Skip to content

[bug fix] fix subtle bug from netflix/metaflow#2463 #2498

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

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

valayDave
Copy link
Collaborator

The packaging PR #2463 introduced the extract_args_kwargs_from_decorator_spec to parse the decospecs added from the command line. This function has a subtle bug where it returns from the for loop instead of the end of the function.

@valayDave valayDave requested a review from romain-intel July 17, 2025 00:31
@savingoyal savingoyal merged commit 608a238 into Netflix:master Jul 17, 2025
28 checks passed
valayDave added a commit to valayDave/metaflow that referenced this pull request Jul 22, 2025
When doing something like :
```
from metaflow import project

....

mymutableflow.add_decorator(
project, deco_kwargs={"name":"abc"})
```

Metaflow breaks with the error :

```
 File ".../metaflow/flowspec.py", line 312, in _process_config_decorators
    deco.pre_mutate(mutable_flow)
  File "mydeco.py", line 67, in pre_mutate
    mutable_flow.add_decorator(
  File ".../metaflow/user_decorators/mutable_flow.py", line 409, in add_decorator
    _add_flow_decorator(
  File ".../metaflow/user_decorators/mutable_flow.py", line 353, in _add_flow_decorator
      d for d in self._flow_cls._flow_decorators if d.name == flow_deco.name
                                                  ^^^^^^
AttributeError: 'str' object has no attribute 'name'
```

This is because we dont parse the _flow_cls._flow_decorators in the right way (as a dict instead of list)
valayDave added a commit to valayDave/metaflow that referenced this pull request Jul 25, 2025
When doing something like :
```
from metaflow import project

....

mymutableflow.add_decorator(
project, deco_kwargs={"name":"abc"})
```

Metaflow breaks with the error :

```
 File ".../metaflow/flowspec.py", line 312, in _process_config_decorators
    deco.pre_mutate(mutable_flow)
  File "mydeco.py", line 67, in pre_mutate
    mutable_flow.add_decorator(
  File ".../metaflow/user_decorators/mutable_flow.py", line 409, in add_decorator
    _add_flow_decorator(
  File ".../metaflow/user_decorators/mutable_flow.py", line 353, in _add_flow_decorator
      d for d in self._flow_cls._flow_decorators if d.name == flow_deco.name
                                                  ^^^^^^
AttributeError: 'str' object has no attribute 'name'
```

This is because we dont parse the _flow_cls._flow_decorators in the right way (as a dict instead of list)
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