great-salesclerk-84349
01/16/2023, 9:35 PMcode = input("Enter verification code: ")
When I dont have metaflow class, I can see the text on the terminal and enter the text. But when I am using the MF class, it hangs, does not show the text and when I enter the code anyways and press Enter, it continues to hang. I have to abort it eventually.
Any workarounds?dry-beach-38304
01/16/2023, 9:37 PMgreat-salesclerk-84349
01/16/2023, 9:49 PMdry-beach-38304
01/16/2023, 9:53 PMdry-beach-38304
01/16/2023, 9:54 PMdry-beach-38304
01/16/2023, 9:55 PMgreat-salesclerk-84349
01/16/2023, 10:03 PMif __name__ == '__main__':
s = Session()
if s.need_new_session:
get_new_session()
logger.debug("Got new session")
else:
logger.debug("Using old session")
Session is a FlowSpec class. However I notice that no command runs after s = Session() . Basically the if statement does not get executed.dry-beach-38304
01/16/2023, 10:09 PMuse_cli=False as an argument but we don’t have great support for non CL invocation so depends on what you want to do. I am also not sure where need_new_session is coming from? I am still flying a little blind but it may be better to basically do something more like this:
if __name__ == '__main__':
if need_new_session():
session = get_new_session()
else:
session = get_existing_session()
subprocess.check_output(["python", "my_flow.py", "run" "--session", json.dumps(session)])
or something to that nature. In other words, do all the pre-metaflow execution stuff first, compute what you need and then use parameters to pass it to Metaflow.dry-beach-38304
01/16/2023, 10:10 PM