Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Support for plotly 6? (TypeError) #329

Open
auxym opened this issue Dec 16, 2024 · 0 comments
Open

[BUG] Support for plotly 6? (TypeError) #329

auxym opened this issue Dec 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@auxym
Copy link

auxym commented Dec 16, 2024

Describe the bug πŸ–οΈ
Plotly 6.0.0 RC0 is now available from pypi as a prerelease version but causes some issues.

Reproducing the bug πŸ”

from plotly_resampler import FigureResampler, FigureWidgetResampler

import plotly.graph_objects as go

fig = FigureWidgetResampler(go.Figure())

Creates an exception:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], line 1
----> 1 fig = FigureWidgetResampler(go.Figure())

File [~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\plotly_resampler\figure_resampler\figurewidget_resampler.py:96](http://localhost:8888/lab/tree/~/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0/LocalCache/local-packages/Python312/site-packages/plotly_resampler/figure_resampler/figurewidget_resampler.py#line=95), in FigureWidgetResampler.__init__(self, figure, convert_existing_traces, default_n_shown_samples, default_downsampler, default_gap_handler, resampled_trace_prefix_suffix, show_mean_aggregation_size, convert_traces_kwargs, verbose)
     92 elif isinstance(figure, (dict, list)):
     93     # A single trace dict or a list of traces
     94     f.add_traces(figure)
---> 96 super().__init__(
     97     f,
     98     convert_existing_traces,
     99     default_n_shown_samples,
    100     default_downsampler,
    101     default_gap_handler,
    102     resampled_trace_prefix_suffix,
    103     show_mean_aggregation_size,
    104     convert_traces_kwargs,
    105     verbose,
    106 )
    108 if isinstance(figure, AbstractFigureAggregator):
    109     # Copy the `_hf_data` if the previous figure was an AbstractFigureAggregator
    110     # And adjust the default max_n_samples and
    111     self._hf_data.update(
    112         self._copy_hf_data(figure._hf_data, adjust_default_values=True)
    113     )

File [~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\plotly_resampler\figure_resampler\figure_resampler_interface.py:150](http://localhost:8888/lab/tree/~/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0/LocalCache/local-packages/Python312/site-packages/plotly_resampler/figure_resampler/figure_resampler_interface.py#line=149), in AbstractFigureAggregator.__init__(self, figure, convert_existing_traces, default_n_shown_samples, default_downsampler, default_gap_handler, resampled_trace_prefix_suffix, show_mean_aggregation_size, convert_traces_kwargs, verbose)
    148     # make sure that the UIDs of these traces do not get adjusted
    149     self._data_validator.set_uid = False
--> 150     self.add_traces(figure.data, **convert_traces_kwargs)
    151 else:
    152     super().__init__(figure)

File [~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\plotly_resampler\figure_resampler\figure_resampler_interface.py:1172](http://localhost:8888/lab/tree/~/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0/LocalCache/local-packages/Python312/site-packages/plotly_resampler/figure_resampler/figure_resampler_interface.py#line=1171), in AbstractFigureAggregator.add_traces(self, data, max_n_samples, downsamplers, gap_handlers, limit_to_views, **traces_kwargs)
   1169     assert trace is not None
   1170     data[i] = trace
-> 1172 return super(self._figure_class, self).add_traces(data, **traces_kwargs)

TypeError: super(type, obj): obj must be an instance or subtype of type

Expected behavior πŸ”§

Please give a clear and concise description of what you expected to happen.

Screenshots πŸ“Έ

If applicable, add screenshots to help explain your problem.

Environment information: (please complete the following information)

  • OS: Windows 11
  • Python environment:
    • Python version: 3.12.7
    • plotly-resampler environment: e.g.: Jupyter(lab), Dash web app (which browser)
  • plotly-resampler version: 0.10.0

Additional context
Add any other context about the problem here.

@auxym auxym added the bug Something isn't working label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant