Python framework for building efficient data pipelines. It promotes modularity and collaboration, enabling the creation of complex pipelines from simple, reusable components.
Enhanced the Step class and its metaclass StepMetaClass to ensure that the execute method is wrapped only once, even when inherited multiple times. Added tests to verify that the log and wrapper are called only once in such scenarios. Also, included custom metaclass examples and their respective tests.
Related Issue
N/A
Motivation and Context
It was established that (under the right conditions) our code allowed the execute method to be wrapped multiple times, even though we had code in place to prevent that. This reflected outwardly by seeing log duplication. For example like this:
Tested by adding unit tests in tests/steps/test_steps.py to verify that the execute method is wrapped only once and that the log messages are called in the correct order. The tests also cover custom metaclass functionality and ensure that the output validation and logging work as expected.
Screenshots (if appropriate):
...
Types of changes
[x] 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)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Description
Enhanced the Step class and its metaclass StepMetaClass to ensure that the execute method is wrapped only once, even when inherited multiple times. Added tests to verify that the log and wrapper are called only once in such scenarios. Also, included custom metaclass examples and their respective tests.
Related Issue
N/A
Motivation and Context
It was established that (under the right conditions) our code allowed the execute method to be wrapped multiple times, even though we had code in place to prevent that. This reflected outwardly by seeing log duplication. For example like this:
Wrong output:
Expected output:
How Has This Been Tested?
Tested by adding unit tests in tests/steps/test_steps.py to verify that the execute method is wrapped only once and that the log messages are called in the correct order. The tests also cover custom metaclass functionality and ensure that the output validation and logging work as expected.
Screenshots (if appropriate):
...
Types of changes
Checklist: