Skip to content

fix(spanner): upgrade spanner client to latest to support NUMERIC types - #565

Merged
dhui merged 3 commits into
golang-migrate:masterfrom
kylechadha:add-support-for-spanner-numeric-type
May 19, 2021
Merged

dhui merged 3 commits into
golang-migrate:masterfrom
kylechadha:add-support-for-spanner-numeric-type

Conversation

@kylechadha

Copy link
Copy Markdown
Contributor

Update spanner library to latest, cloud.google.com/go/spanner@v1.18.0

This prevents error: :1.57: got "NUMERIC", want scalar type

Fixes: #564

@coveralls

coveralls commented May 14, 2021 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 388

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 57.418%

Totals Coverage Status
Change from base Build 361: 0.0%
Covered Lines: 3611
Relevant Lines: 6289

💛 - Coveralls

dhui
dhui previously approved these changes May 15, 2021

@dhui dhui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for reporting the issue and fixing it!

expected: []string{"ALTER TABLE users ALTER COLUMN created SET OPTIONS (allow_commit_timestamp = true)"},
},
{
name: "column with NUMERIC type",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This only tests that cleanStatements() passes. It doesn't test running the statement against the emulator. Was this your intention?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Whoops, just updated where the last spanner upgrade PR did #427 -- will add a migration to test this case as well. Let me know if there's anywhere else that should be updated!

@dhui dhui May 18, 2021 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If DDL parsing is all you want to test, then this is fine. But if you want to test table creation, then this doesn't test that. I'm fine either way.

EDIT: I see you added a new example migration that creates a table w/ a numeric column. These examples should be run as part of a normal test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @dhui not sure I understand, when you say 'these examples' are you saying the tests are good as is, or that I should remove the migrations and add a new test function? If you have an example of what you're referring to that would be great

@kylechadha

Copy link
Copy Markdown
Contributor Author

@dhui Looks like the Spanner tests pass -- Not sure why the Cassandra migrations would have failed. Possible they're flappy?

@dhui
dhui merged commit 1695f40 into golang-migrate:master May 19, 2021
@kylechadha
kylechadha deleted the add-support-for-spanner-numeric-type branch May 19, 2021 16:11
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.

Spanner NUMERIC types not supported by current spanner client v1.9.0

3 participants