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

Add support for selecting language in snowflake_procedure #948

Closed
piotrszwajkowski opened this issue Mar 24, 2022 · 6 comments
Closed

Add support for selecting language in snowflake_procedure #948

piotrszwajkowski opened this issue Mar 24, 2022 · 6 comments
Labels
feature-request Used to mark issues with provider's missing functionalities

Comments

@piotrszwajkowski
Copy link

piotrszwajkowski commented Mar 24, 2022

Describe the solution you'd like

As as a user of terraform resource called snowflake_procedure I'd like to have possibility to select language, in which the procedure is written.

According to Snowflake documentation for stored procedures Snowflake supports languages as in the following:

You can write a stored procedure in one of the following languages:
JavaScript
Snowflake Scripting
Scala (using Snowpark)
Java (using Snowpark)

Unfortunately Snowflake terraform resource provider in snowflake_procedure does not support selecting language, and Javascript is used as a default language.

Describe alternatives you've considered

Not available.

Additional context

Links to documentation pages:
https://docs.snowflake.com/en/sql-reference/stored-procedures-overview.html
https://registry.terraform.io/providers/chanzuckerberg/snowflake/latest/docs/resources/procedure

@piotrszwajkowski piotrszwajkowski added the feature-request Used to mark issues with provider's missing functionalities label Mar 24, 2022
emancu added a commit to emancu/terraform-provider-snowflake that referenced this issue May 19, 2022
Implements Snowflake-Labs#948

The previous behaviour was always setting `JAVASCRIPT` as language.
The implementation in this PR breaks the "backwards compatibility" with that rule to honor the Snowflake default: `SQL`.
emancu added a commit to emancu/terraform-provider-snowflake that referenced this issue May 24, 2022
Implements Snowflake-Labs#948

The previous behaviour was always setting `JAVASCRIPT` as language.
The implementation in this PR breaks the "backwards compatibility" with that rule to honor the Snowflake default: `SQL`.
sfc-gh-swinkler added a commit that referenced this issue May 26, 2022
* Add support for selecting language in snowflake_procedure

Implements #948

The previous behaviour was always setting `JAVASCRIPT` as language.
The implementation in this PR breaks the "backwards compatibility" with that rule to honor the Snowflake default: `SQL`.

* Update documentation for `procedure_grant` and `function_grant` as requested

* Generate docs with `make check-docs`

* Update docs

Co-authored-by: Allison Doami <[email protected]>
Co-authored-by: Scott Winkler <[email protected]>
@yo0824
Copy link

yo0824 commented Jan 27, 2023

I think RUNTIME_VERSION, PACKAGES and HANDLER fields are also necessary when selecting Java, Scala and Python languages.

@pedro-geraghty-sw
Copy link

pedro-geraghty-sw commented Feb 9, 2023

Hi, it's possible to deploy a store procedure selecting python as the language? I'm trying and gives me the following error: _│ Error: expected language to be one of [javascript java scala SQL], got PYTHON.

I'm using version 1.3.3 of terraform with the snowflake provider version 0.54.0

@yo0824
Copy link

yo0824 commented Feb 13, 2023

Seems this is fixed in pr #1516 .

@pedro-geraghty-sw
Copy link

pedro-geraghty-sw commented Feb 13, 2023

Hi, thanks for pointing out to me the issue. But I updated to the latest version of the provider ( I'm using version 1.3.3 of terraform with the snowflake provider version 0.56.3) and stills throw the same error.

I review the main branch and I saw that the language "python" had not been included as an accepted language (procedure.go, line 17):

https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/8321043af1f25f7b3732cc9f4378cbea15efb51a/pkg/resources/procedure.go

@yo0824
Copy link

yo0824 commented Mar 27, 2023

Seems this has been fixed in 0.60.0 .

@sfc-gh-swinkler
Copy link
Collaborator

I am going to go ahead and close this since it is now possible to create procedures using other languages besides javascript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Used to mark issues with provider's missing functionalities
Projects
None yet
Development

No branches or pull requests

4 participants