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

Fix - Set default value for _in_context_attributes_changed_collector #2266

Conversation

trgiangdo
Copy link
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

This PR fixes the problem in https://github.com/Avaiga/taipy-enterprise/pull/559.

When the _in_context_attributes_changed_collector has no value at initialization, and the __getattr__ of an _Entity is called, it will raise AttributeError.

@trgiangdo trgiangdo added the 💥Malfunction Addresses an identified problem. label Nov 21, 2024
@trgiangdo trgiangdo self-assigned this Nov 21, 2024
Copy link
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
19331 16806 87% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
taipy/core/_entity/_entity.py 100% 🟢
TOTAL 100% 🟢

updated for commit: 95aa04c by action🐍

Copy link
Member

@jrobinAV jrobinAV left a comment

Choose a reason for hiding this comment

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

Can we write a small unit test to exhibit the issue?

@trgiangdo
Copy link
Member Author

It only happens in https://github.com/Avaiga/taipy-enterprise/pull/559, where the User.__setattr__() tries to edit the _properties, which triggers the _Properties.__setitem__ when in context, where the _in_context_attributes_changed_collector has no value yet.

@trgiangdo trgiangdo merged commit 7d455d1 into develop Nov 27, 2024
126 checks passed
@trgiangdo trgiangdo deleted the fix/set-default-value-for-_in_context_attributes_changed_collector branch November 27, 2024 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥Malfunction Addresses an identified problem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants