Skip to content

Commit 2dc3e51

Browse files
authored
fix deprecation warning in inspect (#2088)
* fix deprecation warning in inspect * added comment * fixed type of error
1 parent ef46749 commit 2dc3e51

File tree

1 file changed

+5
-1
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+5
-1
lines changed

Diff for: packages/python/plotly/plotly/express/_doc.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import inspect
22
from textwrap import TextWrapper
33

4+
try:
5+
getfullargspec = inspect.getfullargspec
6+
except AttributeError: # python 2
7+
getfullargspec = inspect.getargspec
48

59
# TODO contents of columns
610
# TODO explain categorical
@@ -505,7 +509,7 @@
505509
def make_docstring(fn, override_dict={}):
506510
tw = TextWrapper(width=75, initial_indent=" ", subsequent_indent=" ")
507511
result = (fn.__doc__ or "") + "\nParameters\n----------\n"
508-
for param in inspect.getargspec(fn)[0]:
512+
for param in getfullargspec(fn)[0]:
509513
if override_dict.get(param):
510514
param_doc = override_dict[param]
511515
else:

0 commit comments

Comments
 (0)