def import_from_string(
import_str: str,
*,
is_factory: bool = False,
) -> Tuple[Path, "FastStream"]:
module_path, instance = _import_obj_or_factory(import_str)
if is_factory:
if callable(instance):
instance = instance()
else:
raise typer.BadParameter(f'"{instance}" is not a factory')
return module_path, instance