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 procedures to sdkv2 #2202

Merged
merged 12 commits into from
Dec 8, 2023
Merged

feat: add procedures to sdkv2 #2202

merged 12 commits into from
Dec 8, 2023

Conversation

sfc-gh-swinkler
Copy link
Collaborator

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureArgumentRequest) to ProcedureArgument instead of using struct literal (gosimple)

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureColumnRequest) to ProcedureColumn instead of using struct literal (gosimple)

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedurePackageRequest) to ProcedurePackage instead of using struct literal (gosimple)

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureImportRequest) to ProcedureImport instead of using struct literal (gosimple)

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureSecretRequest) to ProcedureSecret instead of using struct literal (gosimple)

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedurePackageRequest) to ProcedurePackage instead of using struct literal (gosimple)

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureImportRequest) to ProcedureImport instead of using struct literal (gosimple)

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal (gosimple)

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal (gosimple)

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

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal (gosimple)

Copy link

Integration tests failure for 5dba820e79e671d17f8a671fecf14e2d23740b96

pkg/sdk/procedures_def.go Outdated Show resolved Hide resolved
pkg/sdk/procedures_gen.go Show resolved Hide resolved
pkg/sdk/procedures_def.go Outdated Show resolved Hide resolved
pkg/sdk/procedures_def.go Outdated Show resolved Hide resolved
pkg/sdk/procedures_gen.go Outdated Show resolved Hide resolved
pkg/sdk/procedures_impl_gen.go Outdated Show resolved Hide resolved
pkg/sdk/testint/procedures_integration_test.go Outdated Show resolved Hide resolved
pkg/sdk/testint/procedures_integration_test.go Outdated Show resolved Hide resolved
pkg/sdk/testint/procedures_integration_test.go Outdated Show resolved Hide resolved
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/procedures_impl_gen.go|237 col 13| should convert v (type ProcedureColumnRequest) to ProcedureColumn instead of using struct literal
pkg/sdk/procedures_impl_gen.go|249 col 11| should convert v (type ProcedurePackageRequest) to ProcedurePackage instead of using struct literal
pkg/sdk/procedures_impl_gen.go|258 col 11| should convert v (type ProcedureImportRequest) to ProcedureImport instead of using struct literal
pkg/sdk/procedures_impl_gen.go|267 col 11| should convert v (type ProcedureSecretRequest) to ProcedureSecret instead of using struct literal
pkg/sdk/procedures_impl_gen.go|299 col 11| should convert v (type ProcedureArgumentRequest) to ProcedureArgument instead of using struct literal
pkg/sdk/procedures_impl_gen.go|320 col 13| should convert v (type ProcedureColumnRequest) to ProcedureColumn instead of using struct literal
pkg/sdk/procedures_impl_gen.go|332 col 11| should convert v (type ProcedurePackageRequest) to ProcedurePackage instead of using struct literal
pkg/sdk/procedures_impl_gen.go|341 col 11| should convert v (type ProcedureImportRequest) to ProcedureImport instead of using struct literal
pkg/sdk/procedures_impl_gen.go|367 col 11| should convert v (type ProcedureArgumentRequest) to ProcedureArgument instead of using struct literal
pkg/sdk/procedures_impl_gen.go|388 col 13| should convert v (type ProcedureColumnRequest) to ProcedureColumn instead of using struct literal
pkg/sdk/procedures_impl_gen.go|414 col 11| should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal
pkg/sdk/procedures_impl_gen.go|444 col 11| should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal
pkg/sdk/procedures_impl_gen.go|461 col 23| func procedureRow.convert is unused
pkg/sdk/procedures_impl_gen.go|480 col 11| should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal
pkg/sdk/procedures_impl_gen.go|489 col 29| func procedureDetailRow.convert is unused


// CreateProcedureForJavaProcedureOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-procedure.
type CreateProcedureForJavaProcedureOptions 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

create bool `ddl:"static" sql:"CREATE"`
OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`
Secure *bool `ddl:"keyword" sql:"SECURE"`
procedure bool `ddl:"static" sql:"PROCEDURE"`

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 procedure is unused

Arguments []ProcedureArgument `ddl:"parameter,parentheses,no_equals"`
CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"`
Returns *ProcedureReturns `ddl:"keyword" sql:"RETURNS"`
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


// CreateProcedureForJavaScriptProcedureOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-procedure.
type CreateProcedureForJavaScriptProcedureOptions 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

create bool `ddl:"static" sql:"CREATE"`
OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`
Secure *bool `ddl:"keyword" sql:"SECURE"`
procedure bool `ddl:"static" sql:"PROCEDURE"`

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 procedure is unused

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

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 ProcedurePackageRequest) to ProcedurePackage instead of using struct literal

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

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 ProcedureImportRequest) to ProcedureImport instead of using struct literal

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

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 ProcedureSecretRequest) to ProcedureSecret instead of using struct literal

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

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 ProcedureArgumentRequest) to ProcedureArgument instead of using struct literal

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

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 ProcedureArgumentRequest) to ProcedureArgument instead of using struct literal

pkg/sdk/procedures_def.go Outdated Show resolved Hide resolved
pkg/sdk/procedures_def.go Outdated Show resolved Hide resolved
pkg/sdk/procedures_def.go Outdated Show resolved Hide resolved
pkg/sdk/procedures_def.go Outdated Show resolved Hide resolved
pkg/sdk/procedures_def.go Show resolved Hide resolved
pkg/sdk/procedures_def.go Show resolved Hide resolved
pkg/sdk/procedures_gen.go Outdated Show resolved Hide resolved
id := sdk.NewSchemaObjectIdentifier(databaseTest.Name, schemaTest.Name, name)

as := `
import joblib
Copy link
Collaborator

@sfc-gh-jcieslak sfc-gh-jcieslak Nov 22, 2023

Choose a reason for hiding this comment

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

We should probably run those with go-snowflake exec and implement proper call function in the following pr ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i dont think this is necessary

Copy link
Collaborator

Choose a reason for hiding this comment

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

But we are going for all of the functionalities in the SDK, right ? Maybe we should create at least a follow-up task on creating a call / call with functions to invoke those procedures with SDK

Copy link
Collaborator Author

@sfc-gh-swinkler sfc-gh-swinkler Dec 8, 2023

Choose a reason for hiding this comment

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

added todo comment for this test

/*
todo: add custom operation for:

Copy link

github-actions bot commented Dec 4, 2023

Integration tests failure for a0f9ccdf90b127d39958f4e8d7e47c67ece91bea

Copy link

github-actions bot commented Dec 4, 2023

Integration tests failure for ecf18a02c7c3fabfa58e3b3630521c5e289aed12

Copy link
Collaborator

@sfc-gh-asawicki sfc-gh-asawicki left a comment

Choose a reason for hiding this comment

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

Small ones, and also the build checks are failing, please look at them

pkg/sdk/poc/generator/keyword_builders.go Show resolved Hide resolved
Copy link

github-actions bot commented Dec 7, 2023

Integration tests failure for 5e9c2c263d388a964a0337c8556aece4f1bca7cf

Copy link

github-actions bot commented Dec 7, 2023

Integration tests failure for 5e2469f74549885befccbbca97e23f4e5ee83648

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.

Here also #2202 (comment) other than the comment it's 👍 for me
🥇

@sfc-gh-asawicki sfc-gh-asawicki self-requested a review December 7, 2023 16:26
Copy link

github-actions bot commented Dec 8, 2023

Integration tests failure for 948f478fc2b9d4603e7259f223fd82114eae88d8

sfc-gh-asawicki
sfc-gh-asawicki previously approved these changes Dec 8, 2023
@sfc-gh-swinkler sfc-gh-swinkler merged commit 6b563ac into main Dec 8, 2023
4 of 7 checks passed
@sfc-gh-swinkler sfc-gh-swinkler deleted the procedures branch December 8, 2023 21:22
Copy link

github-actions bot commented Dec 8, 2023

Integration tests failure for 99b8e6362e13592004e7c3c1c3040c7c163500ab

Copy link

github-actions bot commented Dec 8, 2023

Integration tests failure for e791214bcf13c282fd7d710d46dbe2de1c81e034

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