Skip to content

Conversation

@gee-senbong
Copy link
Collaborator

@gee-senbong gee-senbong commented Jan 3, 2026

This PR revises previous PR (#648) to add snowflake integration support.

Command to trigger the script to install Snowflake stored procedure:

python -m nixtla.scripts.snowflake_install_nixtla

@CLAassistant
Copy link

CLAassistant commented Jan 3, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

Experiment Results

Experiment 1: air-passengers

Description:

variable experiment
h 12
season_length 12
freq MS
level None
n_windows 1

Results:

metric timegpt-1 timegpt-1-long-horizon SeasonalNaive Naive
mae 12.6793 11.0623 47.8333 76
mape 0.027 0.0232 0.0999 0.1425
mse 213.936 199.132 2571.33 10604.2
total_time 1.0375 1.5482 0.0044 0.0033

Plot:

Experiment 2: air-passengers

Description:

variable experiment
h 24
season_length 12
freq MS
level None
n_windows 1

Results:

metric timegpt-1 timegpt-1-long-horizon SeasonalNaive Naive
mae 58.1031 58.4587 71.25 115.25
mape 0.1257 0.1267 0.1552 0.2358
mse 4040.21 4110.79 5928.17 18859.2
total_time 0.7791 0.9708 0.0037 0.0032

Plot:

Experiment 3: electricity-multiple-series

Description:

variable experiment
h 24
season_length 24
freq H
level None
n_windows 1

Results:

metric timegpt-1 timegpt-1-long-horizon SeasonalNaive Naive
mae 178.293 268.13 269.23 1331.02
mape 0.0234 0.0311 0.0304 0.1692
mse 121589 219485 213677 4.68961e+06
total_time 1.6286 2.4256 0.0046 0.0042

Plot:

Experiment 4: electricity-multiple-series

Description:

variable experiment
h 168
season_length 24
freq H
level None
n_windows 1

Results:

metric timegpt-1 timegpt-1-long-horizon SeasonalNaive Naive
mae 465.497 346.972 398.956 1119.26
mape 0.062 0.0436 0.0512 0.1583
mse 835021 403760 656723 3.17316e+06
total_time 2.3692 1.7546 0.005 0.0044

Plot:

Experiment 5: electricity-multiple-series

Description:

variable experiment
h 336
season_length 24
freq H
level None
n_windows 1

Results:

metric timegpt-1 timegpt-1-long-horizon SeasonalNaive Naive
mae 558.673 459.757 602.926 1340.95
mape 0.0697 0.0565 0.0787 0.17
mse 1.22723e+06 739114 1.61572e+06 6.04619e+06
total_time 1.4324 0.8476 0.005 0.0044

Plot:

MOD(HASH(unique_id), :MAX_BATCHES) AS gp,
unique_id,
ds,
OBJECT_CONSTRUCT_KEEP_NULL(*) AS data_obj
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OBJECT_CONSTRUCT_KEEP_NULL is used here to handle the case when the historical exog variable has null value. Previous implementation:

(SELECT MOD(HASH(unique_id), :MAX_BATCHES) AS gp, unique_id, ds, y, object_construct(*) AS obj FROM TABLE(:INPUT_DATA)) a,

╔══════════════════════════════════════════════════════════════════════════════╗
║ 🎉 Ready to start forecasting! ║
╚══════════════════════════════════════════════════════════════════════════════╝
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample scripts are generated to show user how to call the stored procedures using the generated sample tables.

Copy link
Collaborator

@JQGoh JQGoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to know that your demo video replicates the earlier behavior, a good start!

Makefile Outdated

format:
@echo "Running black formatter on staged files..."
@git diff --cached --name-only --diff-filter=ACMR | grep '\.py$$' | xargs -r uv run black
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Deployment execution command like
python -m nixtla.scripts.snowflake_install_nixtla can be registered as part of Makefile command.

CREATE OR REPLACE NETWORK RULE {ds_prefix}nixtla_network_rule
MODE = EGRESS
TYPE = HOST_PORT
VALUE_LIST = ('api.nixtla.io');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please help to make this an option that user can customize the domain name, in case we want to use a value other than 'api.nixtla.io'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

```
"""

PACKAGES = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest that the essential packages can be read from the pyproject.toml and on top of that, we add the additional snowflake required dependencies.

The objective is that if Nixtla client has newly introduced dependency, we can automatically consider them than updating this manually for snowflake integration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly the thing that didn't work in snowflake. Snowflake running environment is extremely picky on libraries, it doesn't support many of them, so we have to carefully pick the ones. I spent the most time to figure out this list when I worked on this. But @gee-senbong feel free to try what @JQGoh suggests. Maybe it's much easier to work with now.

Makefile Outdated

format:
@echo "Running black formatter on staged files..."
@git diff --cached --name-only --diff-filter=ACMR | grep '\.py$$' | xargs -r uv run black
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should move to uv format but these two new commands are good to add.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update this to use uv format.

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.

5 participants