Skip to content

Commit

Permalink
chore: Add missing issues to existing TODOs and add missing ones (#2354)
Browse files Browse the repository at this point in the history
Add missing and update existing TODOs while cleaning up the backlog.
  • Loading branch information
sfc-gh-asawicki authored Jan 16, 2024
1 parent d970a56 commit c3bc66c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions pkg/resources/dynamic_table_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions pkg/sdk/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions pkg/sdk/testint/tables_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit c3bc66c

Please sign in to comment.