alteryx / evalml

EvalML is an AutoML library written in python.
https://evalml.alteryx.com
BSD 3-Clause "New" or "Revised" License
757 stars 85 forks source link

ReadtheDocs failure with AutoAPI package #2548

Open angela97lin opened 3 years ago

angela97lin commented 3 years ago

I noticed a weird error in https://github.com/alteryx/evalml/pull/2546, a small PR which moved get_hyperparameter_ranges to PipelineBase.

The failed ReadtheDocs build is here: https://readthedocs.com/projects/feature-labs-inc-evalml/builds/683782/, with the following error:


Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/application.py", line 352, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 296, in build_update
    self.build(to_build,
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 310, in build
    updated_docnames = set(self.read())
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 417, in read
    self._read_serial(docnames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 438, in _read_serial
    self.read_doc(docname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 478, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/io.py", line 221, in read_doc
    pub.publish()
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/core.py", line 217, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/io.py", line 126, in read
    self.parse()
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/readers/__init__.py", line 77, in parse
    self.parser.parse(self.input, document)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/parsers.py", line 104, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 170, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 3005, in text
    self.section(title.lstrip(), source, style, lineno + 1, messages)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2342, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2354, in explicit_construct
    return method(self, expmatch)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2096, in directive
    return self.run_directive(
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2146, in run_directive
    result = directive_instance.run()
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/sphinx/ext/autosummary/__init__.py", line 247, in run
    items = self.get_items(names)
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/autoapi/directives.py", line 21, in get_items
    obj = all_objects[name]
KeyError: 'evalml.pipelines.ClassificationPipeline'

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/feature-labs-inc-evalml/envs/2546/lib/python3.8/site-packages/autoapi/directives.py", line 21, in get_items
    obj = all_objects[name]
KeyError: 'evalml.pipelines.ClassificationPipeline'
The full traceback has been saved in /tmp/sphinx-err-ourgqloi.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

We're able to get around this error by updating docs/source/api_index.rst as follows, but I'm concerned that this issue will rear its head again, since we're still not certain of the root cause. Perhaps this is due to the way that autoapi scans our folders and modules?

Before (on main):

.. autoapisummary::

    evalml.pipelines.PipelineBase
    evalml.pipelines.ClassificationPipeline
    evalml.pipelines.BinaryClassificationPipeline
    evalml.pipelines.MulticlassClassificationPipeline
    evalml.pipelines.RegressionPipeline
    evalml.pipelines.TimeSeriesClassificationPipeline

After:

.. autoapisummary::

    evalml.pipelines.PipelineBase
    evalml.pipelines.classification_pipeline.ClassificationPipeline
    evalml.pipelines.binary_classification_pipeline.BinaryClassificationPipeline
    evalml.pipelines.MulticlassClassificationPipeline
    evalml.pipelines.RegressionPipeline
    evalml.pipelines.TimeSeriesClassificationPipeline
angela97lin commented 2 years ago

Note that I've run into this a few more times after, and each time it was resolved by changing the module we're importing from, so it's worth trying that!