Skip to content

Conversation

sayalaruano
Copy link
Collaborator

No description provided.

@sayalaruano
Copy link
Collaborator Author

I enabled pytest on GitHub Actions, and now it's working for 3.11-3.13 versions, but some errors raised for 3.9 and 3.10. When you are back, please take a look at this @enryH

@sayalaruano sayalaruano requested a review from enryH August 20, 2025 15:04
@enryH
Copy link
Collaborator

enryH commented Aug 22, 2025

I enabled pytest on GitHub Actions, and now it's working for 3.11-3.13 versions, but some errors raised for 3.9 and 3.10. When you are back, please take a look at this @enryH

Very subtle: Turns out the keys in PLOT_BUILDERS are different: vuecore.engines.registry.PLOT_BUILDERS

With the pip package strenum in Python 3.10:

{<EngineType.PLOTLY: 'PLOTLY'>: {<PlotType.SCATTER: 'SCATTER'>: <function vuecore.engines.plotly.scatter.build(data: pandas.core.frame.DataFrame, config: vuecore.schemas.basic.scatter.ScatterConfig) -> plotly.graph_objs._figure.Figure>,
  <PlotType.LINE: 'LINE'>: <function vuecore.engines.plotly.line.build(data: pandas.core.frame.DataFrame, config: vuecore.schemas.basic.line.LineConfig) -> plotly.graph_objs._figure.Figure>,
  <PlotType.BAR: 'BAR'>: <function vuecore.engines.plotly.bar.build(data: pandas.core.frame.DataFrame, config: vuecore.schemas.basic.bar.BarConfig) -> plotly.graph_objs._figure.Figure>,
  <PlotType.BOX: 'BOX'>: <function vuecore.engines.plotly.box.build(data: pandas.core.frame.DataFrame, config: vuecore.schemas.basic.box.BoxConfig) -> plotly.graph_objs._figure.Figure>}}

and with the built-in module for later Python version:

{<EngineType.PLOTLY: 'plotly'>: {<PlotType.SCATTER: 'scatter'>: <function vuecore.engines.plotly.scatter.build(data: pandas.core.frame.DataFrame, config: vuecore.schemas.basic.scatter.ScatterConfig) -> plotly.graph_objs._figure.Figure>,
  <PlotType.LINE: 'line'>: <function vuecore.engines.plotly.line.build(data: pandas.core.frame.DataFrame, config: vuecore.schemas.basic.line.LineConfig) -> plotly.graph_objs._figure.Figure>,
  <PlotType.BAR: 'bar'>: <function vuecore.engines.plotly.bar.build(data: pandas.core.frame.DataFrame, config: vuecore.schemas.basic.bar.BarConfig) -> plotly.graph_objs._figure.Figure>,
  <PlotType.BOX: 'box'>: <function vuecore.engines.plotly.box.build(data: pandas.core.frame.DataFrame, config: vuecore.schemas.basic.box.BoxConfig) -> plotly.graph_objs._figure.Figure>}}

Looking at how you use it, it should not matter... but somehow the key entry is not working as expected. And it seems to work:

import vuecore
import vuecore.engines.registry

k_engine = vuecore.engines.registry.EngineType['PLOTLY']
k_plot = vuecore.engines.registry.PlotType['BAR']
vuecore.engines.registry.PLOT_BUILDERS[k_engine][k_plot]

@enryH
Copy link
Collaborator

enryH commented Aug 22, 2025

So I see the issue now... you try to retrieve the function using the string 'bar' which fails if it is 'BAR'. We need to discuss how to design this. (one option is to say python 3.10 end of life is in October 2026, so probably not super important anymore).

builder_func = get_builder(plot_type="bar", engine=engine)

@sayalaruano sayalaruano merged commit ca7f2eb into main Aug 26, 2025
7 checks passed
@sayalaruano sayalaruano deleted the enable-pytest-ga branch August 26, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants