-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Event consumer API simplification into develop #2566
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments.
Other from the failing linter test, the PR looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new API for handling events via the EventConsumer service along with an extensive suite of tests that cover various event types (scenario, datanode written/deleted/created, and generic events). Key changes include:
- Adding new unit tests to validate filtering and callback delegation for events.
- Refactoring internal core event consumer naming from CoreEventConsumerBase to _CoreEventConsumerBase.
- Updating tests and auxiliary modules to align with the new API and naming conventions.
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/event/test_consumer__on_scenario_created.py | Tests for the scenario created event handling with multiple configuration setups. |
tests/event/test_consumer__on_event.py | Tests for event subscription, duplicate topics, and callback argument handling. |
tests/event/test_consumer__on_datanode_written.py | Tests for datanode written events validating config matches and broadcast behavior. |
tests/event/test_consumer__on_datanode_deleted.py | Tests for datanode deletion events with both matching and non-matching configurations. |
tests/event/test_consumer__on_datanode_created.py | Tests for datanode created events including scenarios with callback arguments and broadcast. |
tests/event/conftest.py | Updates to fixtures supporting the new event consumer API tests. |
tests/core/notification/*.py | Refactoring tests to reflect internal naming changes and validate event registration. |
taipy/gui_core/_context.py | Updated to use the refactored _CoreEventConsumerBase for consistency. |
taipy/core/data/json.py | Minor updates to type-ignore comments for JSON encoder/decoder access. |
taipy/core/common/_check_dependencies.py | Added enterprise edition event package reference. |
taipy/core/notification/_core_event_consumer.py | Renamed the core consumer class to _CoreEventConsumerBase and adjusted related imports. |
taipy/core/scenario/_scenario_manager.py | Added an explicit type ignore comment for tags extraction to satisfy type checking. |
Comments suppressed due to low confidence (1)
taipy/core/scenario/_scenario_manager.py:380
- Consider explicitly casting 'tags' to the expected type (e.g. set or other collection) rather than using a type ignore comment. This may improve code clarity and maintainability.
tags = scenario.properties.get(cls._AUTHORIZED_TAGS_KEY, set()) # type: ignore[var-annotated]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Waiting for discussion to be closed in issue #2306 before merging it into develop. |
What type of PR is this? (Check all that apply)
Description
Open a new API using an EventConsumer Service
Related Tickets & Documents
Checklist
We encourage keeping the code coverage percentage at 80% or above.
If not, explain why:
If not, explain why: