Snowflake-Labs / terraform-provider-snowflake

Terraform provider for managing Snowflake accounts
https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest
MIT License
548 stars 419 forks source link

Snowpark - Python Function ouputs Warning: Unexpected function property returned from Snowflake #2555

Closed wpl-sf-nbirch closed 8 months ago

wpl-sf-nbirch commented 8 months ago

Terraform CLI and Provider Versions

Terraform Cloud v1.7.4

Terraform Configuration

resource "snowflake_function" "ts_lttb" {
  name     = "FUNC_TS_LTTB"
  database = var.snowflake_database
  schema   = var.snowflake_schema
  arguments {
    name = "TIMESTAMP"
    type = "NUMBER"
  }
  arguments {
    name = "VALUE_NUMERIC"
    type = "FLOAT"
  }
  arguments {
    name = "SIZE"
    type = "NUMBER"
  }
  comment             = "Snowpark LTTB Function"
  return_type         = "TABLE (TS NUMBER)"
  null_input_behavior = "CALLED ON NULL INPUT"
  return_behavior     = "VOLATILE"
  language            = "python"
  runtime_version     = "3.11"
  packages            = ["pandas","plotly-resampler","setuptools"]
  handler             = "lttb_run"
  statement           =  <<EOT
from _snowflake import vectorized
import pandas as pd
from plotly_resampler.aggregation.algorithms.lttb_py import LTTB_core_py

class lttb_run:
    @vectorized(input=pd.DataFrame)
    def end_partition(self, df):
        idx = LTTB_core_py.downsample(
            df.TIMESTAMP.to_numpy(),
            df.VALUE_NUMERIC.to_numpy(),
            n_out=df.SIZE.max()
        )
        return df[['TIMESTAMP']].iloc[idx]
EOT
}

Expected Behavior

No warnings to be output for unexpected properties.

Actual Behavior

Warning: Unexpected function property returned from Snowflake

with module.snowflake.snowflake_function.lttb on ../modules/snowflake/functions.tf line 4, in resource "snowflake_function" "ts_lttb":

resource "snowflake_function" "ts_lttb" {

Unexpected function property installed_packages returned from Snowflake

Steps to Reproduce

  1. terraform apply

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

No response

sfc-gh-asawicki commented 8 months ago

Hey @wpl-sf-nbirch. Thanks for creating the issue.

This is a duplicate of #2536. I will close it, check the answer from #2536.