Skip to content
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

[Feature Request] Add hidden as a valid type for the build_option function in option_builder.py #30

Open
zabrewer opened this issue Feb 22, 2024 · 0 comments

Comments

@zabrewer
Copy link

In option_builder (https://github.com/krish-adi/barfi/blob/main/barfi/option_builder.py), the build_option function sets the option and valid types.

When we associate a function to a block e.g.

my_function_name(self):
     do_something
     
my_block.add_compute(my_function_name)

There is no way to pass custom params to the associated function that are not exposed to the user. It's beneficial to be able to pass params to the block's associated function without exposing them to the user.

If we try to do something like add a new param e.g.

my_function_name(self, my_custom_param):
     do_something
     
my_block.add_compute(my_function_name(my_custom_param=my_custom_param))

It won't work because there's no way to provide for both self and my_custom_param.

There are several use cases for this but one is using the streamlit session_state and modifying it based upon which block is running.

Let's say we want a message (streamlit.info) that shows users which block is currently running. We can pass the session state to each block's function and modify the message to output which block is running. This is helpful for blocks with long running tasks and general error messaging to the user when something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant