This PR addresses an issue that crops up when you try to run merlin in an environment where cupy/cudf have been installed but are not available. target_format resolves to DataFrame type but it can be either cudf or pandas and we check for cudf first. In this case we run into errors making the conversion because cudf does not import successfully in these cases. By added these check to the conditional for each conversion we add safeguards that ensure we do not try to convert to a type that does not exist.
This PR addresses an issue that crops up when you try to run merlin in an environment where cupy/cudf have been installed but are not available. target_format resolves to DataFrame type but it can be either cudf or pandas and we check for cudf first. In this case we run into errors making the conversion because cudf does not import successfully in these cases. By added these check to the conditional for each conversion we add safeguards that ensure we do not try to convert to a type that does not exist.