-
Notifications
You must be signed in to change notification settings - Fork 906
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
Consider using run(standalone_mode=True)
to fix packaged Kedro project getting a sys.exit
#2682
Comments
run(standalone_mode=True
to fix packaged Kedro project getting a sys.exit
run(standalone_mode=True)
to fix packaged Kedro project getting a sys.exit
I'm wondering if, rather than using @click.command("run")
def run_cli(args):
run(args)
def run(args):
... And we only declare the non-Click version as part of the public API so that people don't import the Click one:
That way we decouple ourselves from Click a bit. I'm personally not very happy about how conversations get shut down over there pallets/click#2249 (comment) |
This should be discussed in Tech Design through Packaged kedro pipeline does not work well on Databricks#1807 first before it's implemented. |
It would be something very similar to |
The entrypoint should be a click one, because that allows the execution of your packaged app as run arguments, i.e. |
https://www.reddit.com/r/Python/comments/7xdi5r/is_sysexit_bad_practice/ and https://click.palletsprojects.com/en/7.x/exceptions/ using For the record we say |
I've changed my mind on this issue - it always felt like a hack... but the problem is on click questionable decision of raise an exception for control flow, not our use of |
Closing this because it's addressed in #4026 |
Background
#1807 (comment)
Consider using
run(standalone_mode=True
to fix the issueWhy is it important?
Any packaged project is run as a
click
program, which generate asys.exit
that exit the program and causing integration withkedro
pipeline impossible.For example, you may want to have some normal Python code which consume the output of a Kedro pipeline. We shouldn't force users to use Kedro for everything and it should be easy to integrate with Kedro.
Workaround
The current workaround is mentioned in Packaged kedro pipeline does not work well on Databricks, which is the recommend way to run packaged project on Databricks now. This is no difference from running Kedro in project mode. The issue is quite similar but Databricks is a specific case and this is more general. We should document it clearly what are the 2 modes for Add documentation about what the bootstrap_project and configure_project methods do and what they're supposed to be used for
There is also a ticket discuss whether we should get rid of
cli.py
. In #1423, noted that the workaround above does not work if the project have a customcli.py
.The text was updated successfully, but these errors were encountered: