Hi team. Happy Friday everyone. First post here, s...
# ask-metaflow
a
Hi team. Happy Friday everyone. First post here, so, first, thanks everyone for the work you put into the project! Quick question about this error:
Copy code
E   metaflow.decorators.DuplicateFlowDecoratorException: Flow already has a decorator 'named_env_base'. You can specify each decorator only once.
• I have two flows in the same directory (say
flow_A
and
flow_B
). • Both use the same line
@named_env_base(name="my_project:latest")
to set up the conda env for the flow. • In each one of those files I also have a config data class. • Outside of those files, I import those config classes and instantiate those configs to run some tests. When importing the config from
flow_A
, all goes well. That is the flow that first had the
@named_env_base(name="my_project:latest")
decorator. But when importing the config dataclass from
flow_B
, I get the error at the start of this message. ◦ This is not about
flow_B
itself: if I import first from
flow_B
, the same error occurs when tryng to do the second import, now from
flow_A
. Is this intentional? _Are people not supposed to import two files containing flows with the same conda/named_env decorator?_ Why? If this is considered a bug, I'm happy to open an issue. For now I think I'll move the configs out of the flow files, but I really liked having the configs and the flows in the same file.
d
Did you update to the latest metaflow? I think this was fixed.
If not, I can take another look at this but I remember doing some fix around this.
a
Not latest, but recent, 2.12.2. These is my metaflow and netflix extensions versions:
Copy code
metaflow                  2.12.2             pyhd8ed1ab_0    conda-forge
metaflow-netflixext       1.2.0              pyhd8ed1ab_0    conda-forge
I already did a workaround, but I'll see if I can reproduce the issue in 2.12.7.
d
This is the fix: https://github.com/Netflix/metaflow/pull/1886; it was first released in 2.12.4
a
That's awesome. Thank you, @dry-beach-38304!