Closed afzal442 closed 1 year ago
@afzal442 Thanks! The implementation seems pretty fixed for the arguments of the create
operation, and it will be difficult to maintain and expand. After all, there are many more commands that we would like to support.
I think the alternative approach posted by @shailendrasingh117 will be more modular. Maybe you can both collaborate on a single solution?
Thanks @mcopik for the review! we can support for create
operation by adding condition if cmd == `create`
simply now.
Talking about the alternative approach, I had that same thing figured out but I don't know the use cases of get_data and set_data. That idea support for cmd is limited. What if cmd is sth else like connect
if command not in COMMANDS: click.echo(f"Invalid command: {command}")
. I'm not sure what it does and how it calls unkown methods.
create_node(**kwargs)
elif command == "get_data":
get_data(**kwargs)
elif command == "set_data":
set_data(**kwargs)
LMK what you think.
This approach can also make it difficult to handle errors in a consistent way. If an unknown command is passed to the dispatcher, the current implementation simply prints an error message to the console. However, in a more complex application, it might be more appropriate to raise an exception or return an error code to the caller. @mcopik @afzal442
Closed as no progress
For #20
e.g.
cc @mcopik