hamilton icon indicating copy to clipboard operation
hamilton copied to clipboard

Improve error message for features that require `ENABLE_POWER_USER_MODE` set to `True`

Open sT0v opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

When wanting to use @resolve/ other power user features, power user mode must be enabled. It is easy to mistake .enable_dynamic_execution(allow_experimental_mode=True) as a way to enable this.

Error:

File "C:\codebase\venv\lib\site-packages\hamilton\function_modifiers\delayed.py", line 130, in resolve
    if not config[settings.ENABLE_POWER_USER_MODE]:
KeyError: 'hamilton.enable_power_user_mode'

Describe the solution you'd like

Error(
"@{power_user_feature} needs to be enabled via the driver config.\n"
"Try the following to enable it."
".with_config({settings.ENABLE_POWER_USER_MODE:True})"
)

Describe alternatives you've considered I could have read the docs better to find this existing solution.

from hamilton import settings
.with_config({settings.ENABLE_POWER_USER_MODE:True})

Additional context Add any other context or screenshots about the feature request here.

sT0v avatar Sep 11 '24 22:09 sT0v

I think we may want to consider deprecating this requirement -- feels like people naturally self-select for resolve and we don't need as many guard-rails...

elijahbenizzy avatar Sep 11 '24 22:09 elijahbenizzy