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

Predictive analytics not working out of the box when using docker. #24357

Closed
maudrid opened this issue Jun 12, 2023 · 12 comments
Closed

Predictive analytics not working out of the box when using docker. #24357

maudrid opened this issue Jun 12, 2023 · 12 comments
Labels
#bug Bug report

Comments

@maudrid
Copy link

maudrid commented Jun 12, 2023

When deploying Superset using the official docker image, the predictive analytics functionality does not work.
This is due to missing dependencies.

How to reproduce the bug

  1. Run Supserset using docker and the apache/superset:2.1.0 image.
  2. Create any Timeseries chart and check the "ENABLE FORECAST' box under 'Predictive analytics'.
  3. Update the chart and receive an error message: 'Error loading data from cache'.

Expected results

The chart to show predictions.

Actual results

Update the chart and receive an error message: 'Error loading data from cache' and the log contains:

force_cached (QueryContext): value not found for key f1510b265fdd1416331715b54d95d017
WARNING:superset.common.utils.query_cache_manager:force_cached (QueryContext): value not found for key f1510b265fdd1416331715b54d95d017

Workaround / Fix

In order to remove the error, you need to build a new docker image with the following lines:

FROM apache/superset:2.1.0
USER root
RUN pip install --upgrade pip
RUN pip install lunarcalendar tqdm "pystan<3.0" && pip install "prophet>=1.0.1, <1.1"

Can these missing dependencies not be included in the docker image, so that the functionality will work out of the box?

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [ x ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ x ] I have reproduced the issue with at least the latest released version of superset.
  • [ x ] I have checked the issue tracker for the same issue and I haven't found one similar. There are several issues where people struggle to get this to work, why not include it in the image so that we don't have to manually add this?
@maudrid maudrid added the #bug Bug report label Jun 12, 2023
@sebastianliebscher
Copy link
Contributor

AFAIK Predictive forecasting is an optional feature introduced with #10324. So at the moment your current workaround is the actual intended way to enable this feature. To me this does not look like a bug, but I see two issues here:

  • predictive forecasting should be mentioned in the Superset docs whether it's optional or not and how to enable it (from scratch install vs docker install)
  • as predictive forecasting is baked into the UI independent of it is enabled or not, I also think it should be a default feature

Unfortunately, the integration tests for this feature are currently failing (at least for me). #24406

@maudrid
Copy link
Author

maudrid commented Jun 16, 2023

If this is an optional feature, there should be a feature flag that enables it.
Having pieces of the UI just fail with uninformative errors, is just bad.
In addition to a feature flag, there should be documentation on how to enable it.

@sebastianliebscher
Copy link
Contributor

In the UI, when enabling this feature it should cleanly prompt the information "missing requirement 'prophet'". Maybe your issue is related with caching activated which it is not by default. Can you test the same without caching?

@maZahaca
Copy link

maZahaca commented Nov 3, 2023

Any ready to go docker images available? like the one you have for -dev dev?

@Razikus
Copy link

Razikus commented Feb 28, 2024

bump

@rusackas
Copy link
Member

@Razikus what version of Superset are you running? The rest of the thread is from the 2.x era. I wouldn't think we're seeing this in 3.1, and we should close this issue if not.

@Razikus
Copy link

Razikus commented Feb 28, 2024

In prod version in 3.11 it's the same
Prophet not installed

@rusackas
Copy link
Member

Ahh... this PR is the reason (and provides context).

From Updating.md:

Facebook Prophet has been introduced as an optional dependency to add support for timeseries forecasting in the chart data API. To enable this feature, install Superset with the optional dependency prophet or directly pip install fbprophet

I think with that, we probably ought to close this out, since it's not a bug, but I'll leave it open for now for further discussion, or in hopes that someone might have some cycles to improve the documentation so others don't get tripped up on this.

@maudrid
Copy link
Author

maudrid commented Feb 28, 2024 via email

@rusackas
Copy link
Member

No disagreement, I think that's the right thing to do. We can call that a bug for now. I'd encourage anyone interested in this thread to open a PR though, as I don't think any of the core committers have this high on their list.

@Razikus
Copy link

Razikus commented Feb 29, 2024

Awesome guys thanks for quick answer
For me finally it worked but it works only with time series not SQL

@rusackas
Copy link
Member

Hey all. It's been another 6 months since this thread was touched, so I'll go ahead and close it out as... uh... explained? Sounds like folks get the idea of the optionality. If there's a cool way to hide the control when the dependency is not present, we'd be open to that sort of "dynamic controls" PR.

@rusackas rusackas closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

5 participants