My team is using the "--branch" and "--production"...
# ask-metaflow
f
My team is using the "--branch" and "--production" arguments and these command line options seem to be broken starting 2.12.4 ("Error: no such option: --branch"). Is this expected and/or do we need to do something different?
f
Just tested and it works on my laptop
c
Does the flow you are trying to run use @project? If not, then that error message is expected.
1
f
We are using @project and when I downgrade to 2.12.3 it works fine
👀 1
If this is expected to dig a little deeper on why this is happening but aside from the .3 to .4 update there are no changes.
c
I have not been able to reproduce - Metaflow versions 2.12.3 and 2.12.4 seem to both be able to run all combinations of --branch and --production as expected. This is the flow I'm testing with:
Copy code
from metaflow import FlowSpec, step, project

@project(name='test_deco')
class F(FlowSpec):

    @step
    def start(self):
        self.next(self.end)

    @step
    def end(self):
        pass

if __name__ == '__main__':
    F()
Can you send a template of the flow that is not working for you?
f
Yeah, will work on a minimal, non-confidential flow that I can share.
Ok, I found the reason why this failed for us. We have custom code to dynamically (not in code) add flow decorators. As part of that I am overriding the constructor of the FlowSpec in a subclass that our flow then inherit from. Since the handling of the CLI changed with the parameters context in 2.12.4, this broke our code.
c
Are you able to update the constructor to work with the recent Metaflow version?
f
Currently it does not look like a straightforward replication of the changes you did but I need to dig deeper next week. I am assuming there is no way to dynamically add flow decorators in an official way (haven't looked specifically into your improvements in 2.12.x)? What we are doing is in the constructor for a FlowSpec befire the CLI logic is called we are adding instances of flow decorators to
flow._flow_decorators
and then invoking the CLI as if use_cli was True.
c
Got it. I'm not aware of an official path for dynamically adding decorators like this.