Skip to content

Improve dynamic resolver power user mode error#1604

Open
officialasishkumar wants to merge 1 commit into
apache:mainfrom
officialasishkumar:fix/power-user-mode-error
Open

Improve dynamic resolver power user mode error#1604
officialasishkumar wants to merge 1 commit into
apache:mainfrom
officialasishkumar:fix/power-user-mode-error

Conversation

@officialasishkumar
Copy link
Copy Markdown

Improves the error raised when dynamic resolver decorators are used without enabling power user mode, including the case where the config key is missing entirely.

Changes

  • Replaced direct indexing of hamilton.enable_power_user_mode with a defaulted config lookup.
  • Updated the error text to point users at .with_config({'hamilton.enable_power_user_mode': True}).
  • Added regression coverage for both explicit False and missing power-user-mode config.

How I tested this

  • uv run --with pytest pytest tests/function_modifiers/test_delayed.py::test_delayed_without_power_mode_fails tests/function_modifiers/test_delayed.py::test_delayed_without_power_mode_config_fails_with_helpful_error
  • uv run ruff format --check hamilton/function_modifiers/delayed.py tests/function_modifiers/test_delayed.py
  • uv run ruff check hamilton/function_modifiers/delayed.py tests/function_modifiers/test_delayed.py

Notes

Fixes #1135.

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

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

Successfully merging this pull request may close these issues.

Improve error message for features that require ENABLE_POWER_USER_MODE set to True

1 participant