Skip to content

[BUG]: Duplicate FigureWidget import code in graph_objects and graph_objs #5849

Open

Description

@camdecoster

Description

The FigureWidget import code is duplicated in graph_objects and graph_objs.

Steps to reproduce

  • Open codegen/__init__.py and find optional_figure_widget_import.
  • Note that the codegen passes the string to write_init_py for graph_objs and to build_from_imports_py for graph_objects.
  • Open plotly/graph_objs/__init__.py and plotly/graph_objects/__init__.py.
  • Note the identical FigureWidget blocks at the end of each file.

Notes

  • The codegen writes the same optional FigureWidget import block into two generated files: plotly/graph_objs/__init__.py and plotly/graph_objects/__init__.py
  • graph_objects already re-exports every other class from graph_objs, including Figure. FigureWidget can follow the same path, because graph_objs handles the optional ipywidgets import and the missing_* fallback.
  • Any fix should not change behavior. This is just about removing duplicate code.
  • Related:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions