From c3bc66cffa4b87c49e027cc685df1abd8a6ebfe6 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Tue, 16 Jan 2024 13:59:07 +0100 Subject: [PATCH] chore: Add missing issues to existing TODOs and add missing ones (#2354) Add missing and update existing TODOs while cleaning up the backlog. --- pkg/resources/dynamic_table_acceptance_test.go | 1 + ...ail_notification_integration_acceptance_test.go | 2 +- pkg/resources/task.go | 2 +- pkg/sdk/tables.go | 6 ++++++ pkg/sdk/testint/tables_integration_test.go | 14 +++++++------- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/pkg/resources/dynamic_table_acceptance_test.go b/pkg/resources/dynamic_table_acceptance_test.go index a685561706..6a59b1c37d 100644 --- a/pkg/resources/dynamic_table_acceptance_test.go +++ b/pkg/resources/dynamic_table_acceptance_test.go @@ -301,6 +301,7 @@ func testAccCheckDynamicTableDestroy(s *terraform.State) error { return nil } +// TODO [SNOW-926148]: currently this dynamic table is not cleaned in the test; it is removed when the whole database is removed - this currently happens in a sweeper func createDynamicTableOutsideTerraform(t *testing.T, schemaName string, dynamicTableName string, query string) { t.Helper() client, err := sdk.NewDefaultClient() diff --git a/pkg/resources/email_notification_integration_acceptance_test.go b/pkg/resources/email_notification_integration_acceptance_test.go index ace8bcaf9c..11c29a06b2 100644 --- a/pkg/resources/email_notification_integration_acceptance_test.go +++ b/pkg/resources/email_notification_integration_acceptance_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) -// TODO: use email of our service user +// TODO [SNOW-1007539]: use email of our service user func TestAcc_EmailNotificationIntegration(t *testing.T) { emailIntegrationName := strings.ToUpper(acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)) verifiedEmail := "artur.sawicki@snowflake.com" diff --git a/pkg/resources/task.go b/pkg/resources/task.go index ae9f53d7da..d6eed48516 100644 --- a/pkg/resources/task.go +++ b/pkg/resources/task.go @@ -530,7 +530,7 @@ func UpdateTask(d *schema.ResourceData, meta interface{}) error { toAdd = append(toAdd, sdk.NewSchemaObjectIdentifier(taskId.DatabaseName(), taskId.SchemaName(), dep)) } } - // TODO [SNOW-884987]: for now leaving old copy-pasted implementation; extract function for task suspension in following change + // TODO [SNOW-1007541]: for now leaving old copy-pasted implementation; extract function for task suspension in following change if len(toAdd) > 0 { // need to suspend any new root tasks from dependencies before adding them for _, dep := range toAdd { diff --git a/pkg/sdk/tables.go b/pkg/sdk/tables.go index e43079cfa2..7712b7a4ba 100644 --- a/pkg/sdk/tables.go +++ b/pkg/sdk/tables.go @@ -8,6 +8,12 @@ import ( var _ convertibleRow[Table] = new(tableDBRow) +// TODO [SNOW-1007542]: add missing features: +// - show columns (https://docs.snowflake.com/en/sql-reference/sql/show-columns) +// - show primary keys (https://docs.snowflake.com/en/sql-reference/sql/show-primary-keys) +// - describe search optimization (https://docs.snowflake.com/en/sql-reference/sql/desc-search-optimization) +// - truncate table (https://docs.snowflake.com/en/sql-reference/sql/truncate-table) +// - undrop table (https://docs.snowflake.com/en/sql-reference/sql/undrop-table) type Tables interface { Create(ctx context.Context, req *CreateTableRequest) error CreateAsSelect(ctx context.Context, req *CreateTableAsSelectRequest) error diff --git a/pkg/sdk/testint/tables_integration_test.go b/pkg/sdk/testint/tables_integration_test.go index a8275d32b9..5198b5eec1 100644 --- a/pkg/sdk/testint/tables_integration_test.go +++ b/pkg/sdk/testint/tables_integration_test.go @@ -209,7 +209,7 @@ func TestInt_Table(t *testing.T) { assertColumns(t, expectedColumns, tableColumns) }) - // TODO: fix this test, it should create two integer column but is creating 3 text ones instead + // TODO [SNOW-1007542]: fix this test, it should create two integer column but is creating 3 text ones instead t.Run("create table using template", func(t *testing.T) { fileFormat, fileFormatCleanup := createFileFormat(t, client, schema.ID()) t.Cleanup(fileFormatCleanup) @@ -645,7 +645,7 @@ func TestInt_Table(t *testing.T) { assert.Equal(t, table.Comment, "") }) - // TODO: check added constraints + // TODO [SNOW-1007542]: check added constraints // Add method similar to getTableColumnsFor based on https://docs.snowflake.com/en/sql-reference/info-schema/table_constraints. t.Run("alter constraint: add", func(t *testing.T) { name := random.String() @@ -676,7 +676,7 @@ func TestInt_Table(t *testing.T) { require.NoError(t, err) }) - // TODO: check renamed constraint + // TODO [SNOW-1007542]: check renamed constraint t.Run("alter constraint: rename", func(t *testing.T) { name := random.String() id := sdk.NewSchemaObjectIdentifier(database.Name, schema.Name, name) @@ -701,7 +701,7 @@ func TestInt_Table(t *testing.T) { require.NoError(t, err) }) - // TODO: check altered constraint + // TODO [SNOW-1007542]: check altered constraint t.Run("alter constraint: alter", func(t *testing.T) { t.Skip("Test is failing: generated statement is not compiling but it is aligned with Snowflake docs https://docs.snowflake.com/en/sql-reference/sql/alter-table#syntax. Requires further investigation.") name := random.String() @@ -723,7 +723,7 @@ func TestInt_Table(t *testing.T) { require.NoError(t, err) }) - // TODO: check dropped constraint + // TODO [SNOW-1007542]: check dropped constraint t.Run("alter constraint: drop", func(t *testing.T) { t.Skip("Test is failing: generated statement is not compiling but it is aligned with Snowflake docs https://docs.snowflake.com/en/sql-reference/sql/alter-table#syntax. Requires further investigation.") name := random.String() @@ -830,7 +830,7 @@ func TestInt_Table(t *testing.T) { assertColumns(t, expectedColumns, currentColumns) }) - // TODO: check search optimization - after adding https://docs.snowflake.com/en/sql-reference/sql/desc-search-optimization + // TODO [SNOW-1007542]: check search optimization - after adding https://docs.snowflake.com/en/sql-reference/sql/desc-search-optimization t.Run("add search optimization", func(t *testing.T) { name := random.String() id := sdk.NewSchemaObjectIdentifier(database.Name, schema.Name, name) @@ -850,7 +850,7 @@ func TestInt_Table(t *testing.T) { require.NoError(t, err) }) - // TODO: try to check more sets (ddl collation, max data extension time in days, etc.) + // TODO [SNOW-1007542]: try to check more sets (ddl collation, max data extension time in days, etc.) t.Run("set: with complete options", func(t *testing.T) { name := random.String() id := sdk.NewSchemaObjectIdentifier(database.Name, schema.Name, name)