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

feat: add functions to sdk #2205

Merged
merged 21 commits into from
Dec 21, 2023
Merged

feat: add functions to sdk #2205

merged 21 commits into from
Dec 21, 2023

Conversation

sfc-gh-swinkler
Copy link
Collaborator

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

staticcheck

pkg/sdk/functions_impl_gen.go|257 col 13| should convert v (type FunctionColumnRequest) to FunctionColumn instead of using struct literal
pkg/sdk/functions_impl_gen.go|278 col 11| should convert v (type FunctionImportsRequest) to FunctionImports instead of using struct literal
pkg/sdk/functions_impl_gen.go|287 col 11| should convert v (type FunctionPackagesRequest) to FunctionPackages instead of using struct literal
pkg/sdk/functions_impl_gen.go|296 col 11| should convert v (type FunctionSecretRequest) to FunctionSecret instead of using struct literal
pkg/sdk/functions_impl_gen.go|328 col 11| should convert v (type FunctionArgumentRequest) to FunctionArgument instead of using struct literal
pkg/sdk/functions_impl_gen.go|344 col 13| should convert v (type FunctionColumnRequest) to FunctionColumn instead of using struct literal
pkg/sdk/functions_impl_gen.go|365 col 11| should convert v (type FunctionImportsRequest) to FunctionImports instead of using struct literal
pkg/sdk/functions_impl_gen.go|374 col 11| should convert v (type FunctionPackagesRequest) to FunctionPackages instead of using struct literal
pkg/sdk/functions_impl_gen.go|402 col 11| should convert v (type FunctionArgumentRequest) to FunctionArgument instead of using struct literal
pkg/sdk/functions_impl_gen.go|418 col 13| should convert v (type FunctionColumnRequest) to FunctionColumn instead of using struct literal
pkg/sdk/functions_impl_gen.go|451 col 11| should convert v (type FunctionArgumentTypeRequest) to FunctionArgumentType instead of using struct literal
pkg/sdk/functions_impl_gen.go|484 col 11| should convert v (type FunctionArgumentTypeRequest) to FunctionArgumentType instead of using struct literal
pkg/sdk/functions_impl_gen.go|501 col 22| func functionRow.convert is unused
pkg/sdk/functions_impl_gen.go|524 col 11| should convert v (type FunctionArgumentTypeRequest) to FunctionArgumentType instead of using struct literal
pkg/sdk/functions_impl_gen.go|533 col 28| func functionDetailRow.convert is unused


// CreateFunctionForJavaFunctionOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-function.
type CreateFunctionForJavaFunctionOptions struct {
create bool `ddl:"static" sql:"CREATE"`

Choose a reason for hiding this comment

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

🚫 [staticcheck] <U1000> reported by reviewdog 🐶
field create is unused

OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`
Temporary *bool `ddl:"keyword" sql:"TEMPORARY"`
Secure *bool `ddl:"keyword" sql:"SECURE"`
function bool `ddl:"static" sql:"FUNCTION"`

Choose a reason for hiding this comment

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

🚫 [staticcheck] <U1000> reported by reviewdog 🐶
field function is unused

CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"`
Returns *FunctionReturns `ddl:"keyword" sql:"RETURNS"`
ReturnNullValues *FunctionReturnNullValues `ddl:"keyword"`
languageJava bool `ddl:"static" sql:"LANGUAGE JAVA"`

Choose a reason for hiding this comment

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

🚫 [staticcheck] <U1000> reported by reviewdog 🐶
field languageJava is unused


// CreateFunctionForJavascriptFunctionOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-function.
type CreateFunctionForJavascriptFunctionOptions struct {
create bool `ddl:"static" sql:"CREATE"`

Choose a reason for hiding this comment

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

🚫 [staticcheck] <U1000> reported by reviewdog 🐶
field create is unused

OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`
Temporary *bool `ddl:"keyword" sql:"TEMPORARY"`
Secure *bool `ddl:"keyword" sql:"SECURE"`
function bool `ddl:"static" sql:"FUNCTION"`

Choose a reason for hiding this comment

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

🚫 [staticcheck] <U1000> reported by reviewdog 🐶
field function is unused

if r.Packages != nil {
s := make([]FunctionPackages, len(r.Packages))
for i, v := range r.Packages {
s[i] = FunctionPackages{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionPackagesRequest) to FunctionPackages instead of using struct literal

if r.Secrets != nil {
s := make([]FunctionSecret, len(r.Secrets))
for i, v := range r.Secrets {
s[i] = FunctionSecret{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionSecretRequest) to FunctionSecret instead of using struct literal

if r.Arguments != nil {
s := make([]FunctionArgument, len(r.Arguments))
for i, v := range r.Arguments {
s[i] = FunctionArgument{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionArgumentRequest) to FunctionArgument instead of using struct literal

if r.Returns.Table.Columns != nil {
s := make([]FunctionColumn, len(r.Returns.Table.Columns))
for i, v := range r.Returns.Table.Columns {
s[i] = FunctionColumn{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionColumnRequest) to FunctionColumn instead of using struct literal

if r.Arguments != nil {
s := make([]FunctionArgument, len(r.Arguments))
for i, v := range r.Arguments {
s[i] = FunctionArgument{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionArgumentRequest) to FunctionArgument instead of using struct literal

pkg/sdk/functions_def.go Outdated Show resolved Hide resolved
pkg/sdk/functions_def.go Show resolved Hide resolved
pkg/sdk/functions_def.go Outdated Show resolved Hide resolved
pkg/sdk/functions_def.go Outdated Show resolved Hide resolved
pkg/sdk/functions_def.go Outdated Show resolved Hide resolved
pkg/sdk/testint/functions_integration_test.go Outdated Show resolved Hide resolved
pkg/sdk/testint/functions_integration_test.go Show resolved Hide resolved
pkg/sdk/testint/functions_integration_test.go Show resolved Hide resolved
pkg/sdk/testint/functions_integration_test.go Show resolved Hide resolved
pkg/sdk/testint/functions_integration_test.go Show resolved Hide resolved
if r.Returns.Table.Columns != nil {
s := make([]FunctionColumn, len(r.Returns.Table.Columns))
for i, v := range r.Returns.Table.Columns {
s[i] = FunctionColumn{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionColumnRequest) to FunctionColumn instead of using struct literal

if r.Imports != nil {
s := make([]FunctionImports, len(r.Imports))
for i, v := range r.Imports {
s[i] = FunctionImports{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionImportsRequest) to FunctionImports instead of using struct literal

if r.Packages != nil {
s := make([]FunctionPackages, len(r.Packages))
for i, v := range r.Packages {
s[i] = FunctionPackages{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionPackagesRequest) to FunctionPackages instead of using struct literal

if r.Secrets != nil {
s := make([]FunctionSecret, len(r.Secrets))
for i, v := range r.Secrets {
s[i] = FunctionSecret{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionSecretRequest) to FunctionSecret instead of using struct literal

if r.Arguments != nil {
s := make([]FunctionArgument, len(r.Arguments))
for i, v := range r.Arguments {
s[i] = FunctionArgument{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionArgumentRequest) to FunctionArgument instead of using struct literal

if r.ArgumentTypes != nil {
s := make([]FunctionArgumentType, len(r.ArgumentTypes))
for i, v := range r.ArgumentTypes {
s[i] = FunctionArgumentType{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionArgumentTypeRequest) to FunctionArgumentType instead of using struct literal

if r.ArgumentTypes != nil {
s := make([]FunctionArgumentType, len(r.ArgumentTypes))
for i, v := range r.ArgumentTypes {
s[i] = FunctionArgumentType{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionArgumentTypeRequest) to FunctionArgumentType instead of using struct literal

return opts
}

func (r functionRow) convert() *Function {

Choose a reason for hiding this comment

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

🚫 [staticcheck] <U1000> reported by reviewdog 🐶
func functionRow.convert is unused

if r.ArgumentTypes != nil {
s := make([]FunctionArgumentType, len(r.ArgumentTypes))
for i, v := range r.ArgumentTypes {
s[i] = FunctionArgumentType{

Choose a reason for hiding this comment

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

🚫 [staticcheck] <S1016> reported by reviewdog 🐶
should convert v (type FunctionArgumentTypeRequest) to FunctionArgumentType instead of using struct literal

return opts
}

func (r functionDetailRow) convert() *FunctionDetail {

Choose a reason for hiding this comment

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

🚫 [staticcheck] <U1000> reported by reviewdog 🐶
func functionDetailRow.convert is unused

Copy link

Integration tests failure for fc6b2e02e7b2434d3dc7754c4965551484516dc8

Copy link

github-actions bot commented Dec 5, 2023

Integration tests failure for 17ef49f54533d3cbd08bf2147ba5f4c8eecb7a07

Copy link

github-actions bot commented Dec 5, 2023

Integration tests failure for c7fbc465faf91a2e999a9b0f1bee135b99637c16

Copy link

github-actions bot commented Dec 7, 2023

Integration tests failure for a121f435d85c3de5651fca7301e5bfc9d4fd7b40

Copy link

github-actions bot commented Dec 7, 2023

Integration tests failure for 6f9c4a5d97570b431d1eb78f34cf83c5deb062d0

sfc-gh-jcieslak
sfc-gh-jcieslak previously approved these changes Dec 7, 2023
Copy link
Collaborator

@sfc-gh-jcieslak sfc-gh-jcieslak left a comment

Choose a reason for hiding this comment

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

Hey, just leave a comment I've asked for in #2205 (comment) and other than that it's 👍

🥇

pkg/sdk/functions_gen_test.go Show resolved Hide resolved
pkg/sdk/functions_gen_test.go Show resolved Hide resolved
pkg/sdk/functions_gen_test.go Show resolved Hide resolved
pkg/sdk/functions_gen_test.go Show resolved Hide resolved
pkg/sdk/functions_gen_test.go Show resolved Hide resolved
pkg/sdk/functions_gen_test.go Show resolved Hide resolved
pkg/sdk/functions_gen_test.go Show resolved Hide resolved
@Snowflake-Labs Snowflake-Labs deleted a comment from scottwinkler Dec 8, 2023
Copy link

github-actions bot commented Dec 8, 2023

Integration tests failure for 364ce2e4eb27758ef50923f1b5386925d5ccc65c

@sfc-gh-asawicki sfc-gh-asawicki self-requested a review December 8, 2023 14:28
Copy link

github-actions bot commented Dec 9, 2023

Integration tests success for 7cb75f8c3d2be22d22b7c4d32446ff020c96add4

Copy link

Integration tests failure for d532974bf351c3613ca5034154f19187c4e24cc3

Copy link

Integration tests failure for 11d8d82d33d997d8a9a2a4c15ef94d2765bbf803

Copy link

Integration tests failure for 2e6c0e9f20e7faff3ade26d6c46012df7f42b0bf

Copy link

Integration tests failure for a5436b0cb951f8b7c65ce1ac3ad65a458351b1f9

Copy link

Integration tests failure for 3af6f874fdf0fedd1ff2816b3c4fc3d2f68f2836

Copy link

Integration tests failure for a7fd45b0864c1b3231d92b2150485976d8f83110

Copy link

Integration tests failure for 53acfd5c87099c8e334ff80d0705f385eaf037d0

@sfc-gh-asawicki sfc-gh-asawicki merged commit e542b67 into main Dec 21, 2023
6 of 8 checks passed
@sfc-gh-asawicki sfc-gh-asawicki deleted the functions-sdk branch December 21, 2023 10:24
sfc-gh-asawicki pushed a commit that referenced this pull request Dec 21, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.82.0](v0.81.0...v0.82.0)
(2023-12-21)


### 🎉 **What's new:**

* add functions to sdk
([#2205](#2205))
([e542b67](e542b67))


### 🔧 **Misc**

* Add short scripts used to fetch all currently opened issues
([#2288](#2288))
([0b5ce4e](0b5ce4e))
* Bump dependencies and fix linter complaints
([#2300](#2300))
([124e862](124e862))


### 🐛 **Bug fixes:**

* Fix resource monitor alter validations in the SDK
([#2298](#2298))
([74d19d0](74d19d0))
* Fix email notification integration
([#2292](#2292))
([70edd3e](70edd3e))
* Fix for #2283 
([#2284](#2284))
([bbad5c6](bbad5c6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
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.

3 participants