kubeflow / fairing

Python SDK for building, training, and deploying ML models
Apache License 2.0
337 stars 144 forks source link

Unable to get notebook filename on JupyterLab 3.0 #551

Open kangwoo opened 3 years ago

kangwoo commented 3 years ago

/kind bug

What steps did you take and what happened:

/usr/local/lib/python3.6/dist-packages/nbconvert/exporters/exporter.py in from_filename(self, filename, resources, **kw) 165 if not 'metadata' in resources or resources['metadata'] == '': 166 resources['metadata'] = ResourcesDict() --> 167 path, basename = os.path.split(filename) 168 notebook_name = os.path.splitext(basename)[0] 169 resources['metadata']['name'] = notebook_name

/usr/lib/python3.6/posixpath.py in split(p) 105 """Split a pathname. Returns tuple "(head, tail)" where "tail" is 106 everything after the final slash. Either part may be empty.""" --> 107 p = os.fspath(p) 108 sep = _get_sep(p) 109 i = p.rfind(sep) + 1

TypeError: expected str, bytes or os.PathLike object, not NoneType


**What did you expect to happen:**

**Anything else you would like to add:**
Utility function does not return file name.
In[]

from kubeflow.fairing.notebook import notebook_util print(notebook_util.get_notebook_name())

Out[]

None



**Environment:**

- Fairing version: 1.0.2
- Kubeflow version: 1.2.0
- Minikube version:
- Kubernetes version: 1.20.1
- OS (e.g. from `/etc/os-release`): Ubuntu 20.04.2 LTS

**NOTE**: