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

Removing fetching action function name from action_functions dictionary. #46

Merged
merged 8 commits into from
Sep 21, 2023

Conversation

petar-qb
Copy link
Contributor

Description

Now, users are able to create their own custom actions in a following way:

# Defining custom action function
from vizro.models.types import capture

@capture("action")
def custom_action(**inputs):
    print("custom action triggered")
    print(inputs)
    return inputs

# Action model example
vm.Action(
    function=custom_action(),
    inputs=['button_id.value'],
    outputs=['button_id.value'],
)

Screenshot

Checklist

  • I have not referenced individuals, products or companies in any commits, directly or indirectly
  • I have not added data or restricted code in any commits, directly or indirectly
  • I have updated the docstring of any public function/class/model changed
  • I have added the PR number to the change description in the changelog fragment, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) (if applicable)

Types of changes

  • Docs/refactoring (non-breaking change which improves codebase)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

maxschulz-COL
maxschulz-COL previously approved these changes Sep 21, 2023
Copy link
Contributor

@maxschulz-COL maxschulz-COL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Thanks

@maxschulz-COL maxschulz-COL added Status: Ready for Review ☑️ Issue/PR is ready for review - all tests have passed Issue: Bug Report 🐛 Issue/PR that report/fix a bug labels Sep 21, 2023
…stom_actions_unofficially.md

Co-authored-by: Maximilian Schulz <83698606+maxschulz-COL@users.noreply.github.com>
Copy link
Contributor

@nadijagraca nadijagraca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@petar-qb petar-qb merged commit ebba3ed into main Sep 21, 2023
19 checks passed
@petar-qb petar-qb deleted the feature/1057/enable_custom_actions_unofficially branch September 21, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Bug Report 🐛 Issue/PR that report/fix a bug Status: Ready for Review ☑️ Issue/PR is ready for review - all tests have passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants