Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid returning unrelated enum type from
_cache_from_local
(#924)
If an `App` named `FOO` is already loaded in `sys.modules`, then if we try to do `Action("FOO")` or `Trigger("FOO")`, it will try to load that enum from cache, and return the `App` enum object instead. This check avoids that error. <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Fixes bug in `_cache_from_local` in `base.py` to ensure correct enum type is returned by checking `self._model`. > > - **Behavior**: > - Fixes bug in `_cache_from_local` in `base.py` to prevent returning incorrect enum type when `App` is already loaded in `sys.modules`. > - Adds checks for `self._model` to ensure correct enum type (`ActionData`, `AppData`, `TriggerData`) is returned. > - **Misc**: > - No changes to external interfaces or additional functionality. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=ComposioHQ%2Fcomposio&utm_source=github&utm_medium=referral)<sup> for a134cc6. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information