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

BaseModelManager filter method, edits AST in place #987

Open
ekarademir opened this issue Feb 5, 2025 · 0 comments
Open

BaseModelManager filter method, edits AST in place #987

ekarademir opened this issue Feb 5, 2025 · 0 comments
Labels
Type: Bug 🐛 Something isn't working

Comments

@ekarademir
Copy link
Contributor

Bug Report 🐛

BaseModelManager filter operation inadvertently manipulates the AST of any model file in place but then also returns a new filtered model manager. It should do one of them, not both.

This causes a problem, if the model ASTs are kept in memory and reused. Because the operation manipulates those objects in memory without advertising it.

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce

  1. Create several models that depend on each other in memory
  2. Apply a filter operation that would result in removal of imports
  3. Inspect the models in memory

Context (Environment)

Desktop

  • OS: [e.g. macOS]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 0.22.15]

Detailed Description

Possible Implementation

@DianaLease DianaLease added the Type: Bug 🐛 Something isn't working label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants