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

Provenance of created objects #20

Merged
merged 5 commits into from
Aug 8, 2023
Merged

Provenance of created objects #20

merged 5 commits into from
Aug 8, 2023

Conversation

kohlerca
Copy link
Collaborator

@kohlerca kohlerca commented Aug 8, 2023

This PR adds the functionality of tracking the creation of objects using a class constructor.

The intended code to be tracked is shown below:

obj = Constructor(*args, **kwargs)

In this case, the __init__ method returns None; therefore, when the method is instrumented with the Provenance decorator, the actual constructed object is not identified.

With the changes in this PR, the object stored in obj will be tracked as the output of the function Constructor.__init__, to disambiguate from other class methods where the object is the input. For that, the Constructor.__init__ method needs to be instrumented with the decorator, as any other object method.

Unit tests are implemented to check the correct behavior and integration with other provenance tracking functionality already implemented.

Cristiano Köhler added 5 commits April 11, 2023 16:12
# Conflicts:
#	alpaca/code_analysis/ast.py
#	alpaca/decorator.py
#	alpaca/test/test_code_analysis.py
#	alpaca/test/test_decorator.py
@kohlerca kohlerca merged commit 5d46ea7 into main Aug 8, 2023
5 checks passed
@kohlerca kohlerca deleted the feature/class_constructor branch August 8, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant