recommenders-team / recommenders

Best Practices on Recommendation Systems
https://recommenders-team.github.io/recommenders/intro.html
MIT License
18.71k stars 3.06k forks source link

Add missing kernelspec language #2037

Closed SimonYansenZhao closed 9 months ago

SimonYansenZhao commented 9 months ago

Description

This PR corrects the error from the tests for the PR #2035 (https://github.com/recommenders-team/recommenders/actions/runs/6749833187/job/18351722346?pr=2035#step:3:2775)

=================================== FAILURES ===================================
________________________________ test_npa_smoke ________________________________

notebooks = ***'als_deep_dive': '/mnt/azureml/cr/j/0d490b7a2cbb414d9d2f6c8dd0501c51/exe/wd/examples/02_model_collaborative_filtering...rk_movielens': '/mnt/azureml/cr/j/0d490b7a2cbb414d9d2f6c8dd0501c51/exe/wd/examples/06_benchmarks/movielens.ipynb', ...***
output_notebook = 'output.ipynb', kernel_name = 'python3'

    @pytest.mark.notebooks
    @pytest.mark.gpu
    def test_npa_smoke(notebooks, output_notebook, kernel_name):
        notebook_path = notebooks["npa_quickstart"]
>       pm.execute_notebook(
            notebook_path,
            output_notebook,
            kernel_name=kernel_name,
            parameters=dict(epochs=1, seed=42, MIND_type="demo"),
        )

tests/smoke/examples/test_notebooks_gpu.py:190: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/azureml-envs/azureml_7f0e1f5ac7848552bd2cee4736595176/lib/python3.8/site-packages/papermill/execute.py:94: in execute_notebook
    parameter_predefined = _infer_parameters(nb)
/azureml-envs/azureml_7f0e1f5ac7848552bd2cee4736595176/lib/python3.8/site-packages/papermill/inspection.py:42: in _infer_parameters
    language = nb.metadata.kernelspec.language
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = ***'display_name': "Python 3.7.11 64-bit ('tf2': conda)", 'name': 'python3'***
key = 'language'

    def __getattr__(self, key):
        """Get an attr by calling :meth:`dict.__getitem__`.

        Like :meth:`__setattr__`, this method converts :exc:`KeyError` to
        :exc:`AttributeError`.

        Examples
        --------
        >>> s = Struct(a=10)
        >>> s.a
        10
        >>> type(s.get)
        <... 'builtin_function_or_method'>
        >>> try:
        ...     s.b
        ... except AttributeError:
        ...     print("I don't have that key")
        ...
        I don't have that key
        """
        try:
            result = self[key]
        except KeyError:
>           raise AttributeError(key) from None
E           AttributeError: language

/azureml-envs/azureml_7f0e1f5ac7848552bd2cee4736595176/lib/python3.8/site-packages/nbformat/_struct.py:125: AttributeError

Related Issues

References

Checklist: