-
Notifications
You must be signed in to change notification settings - Fork 24
fix: create singleton decorator #100
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
base: main
Are you sure you want to change the base?
fix: create singleton decorator #100
Conversation
…ndle_fab_config_mode
…de' of https://github.com/microsoft/fabric-cli into dev/aviatcohen/avoidReLoginWhenSwitchingToInteractiveMode
| instances[class_] = class_(*args, **kwargs) | ||
| return instances[class_] | ||
|
|
||
| # Add a reset method to the decorator function for testing purposes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if looks like we don't use reset_instance in code, only in tests. if so, let's remove it :) if necessary we will add in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use it in the tests: test_config and test_fab_interactiveCLI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was only used in tests, so I removed it. I don’t think the code should contain test‑specific logic.
📥 Pull Request
✨ Description of new changes
To enable reuse, refactor the singleton logic currently in fab_context into a decorator and apply that decorator within fab_interactive.