From 07ea06357c9288d7a906b7ac226f47263a4e0fba Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 16 Jan 2020 14:33:20 -0500 Subject: [PATCH 1/3] fix deprecation warning in inspect --- packages/python/plotly/plotly/express/_doc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/python/plotly/plotly/express/_doc.py b/packages/python/plotly/plotly/express/_doc.py index 5a920680891..60c93575741 100644 --- a/packages/python/plotly/plotly/express/_doc.py +++ b/packages/python/plotly/plotly/express/_doc.py @@ -1,6 +1,9 @@ import inspect from textwrap import TextWrapper - +try: + getfullargspec = inspect.getfullargspec +except ImportError: + getfullargspec = inspect.getargspec # TODO contents of columns # TODO explain categorical @@ -505,7 +508,7 @@ def make_docstring(fn, override_dict={}): tw = TextWrapper(width=75, initial_indent=" ", subsequent_indent=" ") result = (fn.__doc__ or "") + "\nParameters\n----------\n" - for param in inspect.getargspec(fn)[0]: + for param in getfullargspec(fn)[0]: if override_dict.get(param): param_doc = override_dict[param] else: From 07541e26e7d7ab88c69f0645c6c3a54d9c5b7f5b Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 16 Jan 2020 14:34:33 -0500 Subject: [PATCH 2/3] added comment --- packages/python/plotly/plotly/express/_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/plotly/express/_doc.py b/packages/python/plotly/plotly/express/_doc.py index 60c93575741..4a0d5135a42 100644 --- a/packages/python/plotly/plotly/express/_doc.py +++ b/packages/python/plotly/plotly/express/_doc.py @@ -2,7 +2,7 @@ from textwrap import TextWrapper try: getfullargspec = inspect.getfullargspec -except ImportError: +except ImportError: # python 2 getfullargspec = inspect.getargspec # TODO contents of columns From a435680f822dffd27ca1e33461536bebb66fda96 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 16 Jan 2020 14:39:50 -0500 Subject: [PATCH 3/3] fixed type of error --- packages/python/plotly/plotly/express/_doc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/python/plotly/plotly/express/_doc.py b/packages/python/plotly/plotly/express/_doc.py index 4a0d5135a42..3a5b9344e19 100644 --- a/packages/python/plotly/plotly/express/_doc.py +++ b/packages/python/plotly/plotly/express/_doc.py @@ -1,8 +1,9 @@ import inspect from textwrap import TextWrapper + try: getfullargspec = inspect.getfullargspec -except ImportError: # python 2 +except AttributeError: # python 2 getfullargspec = inspect.getargspec # TODO contents of columns