Repository: apache/superset
File: superset/utils/cache_manager.py (Python)

Code before:
        response_hit_indication: bool | None = False,
    ) -> Callable[..., Any]:
        return super().cached(
            timeout=timeout,
            key_prefix=key_prefix,
            unless=unless,
            forced_update=forced_update,
            response_filter=response_filter,
            query_string=query_string,
            hash_method=hash_method,
            cache_none=cache_none,
            make_cache_key=make_cache_key,
            source_check=source_check,
            response_hit_indication=response_hit_indication,
        )

    # pylint: disable=protected-access
    def _memoize_make_cache_key(
        self,
        make_name: Callable[..., Any] | None = None,
        timeout: Callable[..., Any] | None = None,
        forced_update: bool = False,
        hash_method: Callable[..., Any] = configurable_hash_method,
        source_check: bool | None = False,
        args_to_ignore: Any | None = None,
    ) -> Callable[..., Any]:
        return super()._memoize_make_cache_key(
            make_name=make_name,
            timeout=timeout,
            forced_update=forced_update,
            hash_method=hash_method,
            source_check=source_check,
            args_to_ignore=args_to_ignore,
        )


class ExploreFormDataCache(SupersetCache):
    def get(self, *args: Any, **kwargs: Any) -> Optional[Union[str, Markup]]:
        cache = self.cache.get(*args, **kwargs)

        if not cache:
            return None

        # rename data keys for existing cache based on new TemporaryExploreState model
        if isinstance(cache, dict):
            cache = {
                ("datasource_id" if key == "dataset_id" else key): value
                for (key, value) in cache.items()
            }
            # add default datasource_type if it doesn't exist
            # temporarily defaulting to table until sqlatables are deprecated

Review comment (bug):
Im probably wrong but does the type for timeout looks incorrect? — should this be int | None rather than Callable[..., Any] | None? 
Same question for forced_update on the next line — in flask-caching's signature this is typically Callable[..., bool] | None, not bool. S                     

Code after:
        query_string: bool = False,
        hash_method: Callable[..., Any] = configurable_hash_method,
        cache_none: bool = False,
        make_cache_key: Callable[..., Any] | None = None,
        source_check: bool | None = None,
        response_hit_indication: bool | None = False,
    ) -> Callable[..., Any]:
        return super().cached(
            timeout=timeout,
            key_prefix=key_prefix,
            unless=unless,
            forced_update=forced_update,
            response_filter=response_filter,
            query_string=query_string,
            hash_method=hash_method,
            cache_none=cache_none,
            make_cache_key=make_cache_key,
            source_check=source_check,
            response_hit_indication=response_hit_indication,
        )

    # pylint: disable=protected-access
    def _memoize_make_cache_key(
        self,
        make_name: Callable[..., Any] | None = None,
        timeout: Callable[..., Any] | None = None,
        forced_update: bool = False,
        hash_method: Callable[..., Any] = configurable_hash_method,
        source_check: bool | None = False,
        args_to_ignore: Any | None = None,
    ) -> Callable[..., Any]:
        return super()._memoize_make_cache_key(
            make_name=make_name,
            timeout=timeout,
            forced_update=forced_update,
            hash_method=hash_method,
            source_check=source_check,
            args_to_ignore=args_to_ignore,
        )


class ExploreFormDataCache(SupersetCache):
    def get(self, *args: Any, **kwargs: Any) -> Optional[Union[str, Markup]]:
        cache = self.cache.get(*args, **kwargs)

        if not cache:
            return None

        # rename data keys for existing cache based on new TemporaryExploreState model
        if isinstance(cache, dict):
            cache = {