-
Notifications
You must be signed in to change notification settings - Fork 36
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 crash trying to extend None list member #42
base: main
Are you sure you want to change the base?
Conversation
hello @wakamex, thank you for reporting the issue. I should first investigate why target_fqn is None, this should not happen. I don't have much time to investigate the issue this week, I need some time. Forgive me in advance to keep you waiting 🙏 |
the cause is assignments in base.py: https://github.com/element-fi/elf-simulations/blob/2349ebf365f5c3c589ad42d85a263a241010dac7/elfpy/markets/base.py#L108-L109
replacing our init function with the following also solves the problem (without requiring a tweak to py2puml):
along with moving the I'm not sure why this, but I suspect it's because we're doing something totally-not-good with our type hints hopefully you understand this better than I do 😄 I added a commit here with the print statements I used to arrive at this conclusion |
the diff between the two resulting plantuml's delvtech/agent0@f22a7de |
thanks for investigating the issue 🙏 The main reason of the issue seems this:
Indeed,
In you case, the type associated to If you can, I would recommend to move such dynamic imports at the top of the module and restore your original constructor (with I should definitely think of a safety net for these cases, such as skipping the potential relationship between this class and the attribute's class. Maybe by introducing a default fail-fast mode, and an optional fail-proof mode (producing a degraded class diagram). Side remark: please, follow the contribution guidelines about the use of quotes and the formatting as described in https://github.com/lucsorel/py2puml/blob/main/CONTRIBUTING.md#code-styling 🙏 Your IDE settings seems to reformat all the files you modified and replace single quotes with double quotes, making the codebase inconsistent and hard for me to read. And it makes the pull-request harder to understand. I realize that I should add pre-commit hooks to the project in order to avoid these troubles now that several people are eager to contribute (and thanks again for reporting the issue) 😃 |
hi @wakamex 😃 Did you manage to fix the crash by placing the import at the top of the Python file (without modifying the py2puml code)? |
attempting
py2puml elfpy elfpy > elfpy.plantuml
on https://github.com/element-fi/elf-simulations/tree/2349ebf365f5c3c589ad42d85a263a241010dac7