Skip to content

Commit

Permalink
Fix crash in DatabaseIntrospection.get_table_description() due to Sno…
Browse files Browse the repository at this point in the history
…wflake's DESCRIBE TABLE change.

The "privacy domain" column is new.
  • Loading branch information
timgraham committed Feb 1, 2024
1 parent 6214bce commit 5ecf3e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 5.0.1 - Unreleased

* Fixed crash in `DatabaseIntrospection.get_table_description()` due to
Snowflake adding a column to the output of `DESCRIBE TABLE`.

## 5.0 - 2023-12-16

Initial release for Django 5.0.x.
2 changes: 1 addition & 1 deletion django_snowflake/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
'migrations.test_operations.OperationTests.test_alter_field_add_database_default',
'migrations.test_operations.OperationTests.test_alter_field_change_default_to_database_default',
'migrations.test_operations.OperationTests.test_alter_field_change_nullable_to_database_default_not_null',
'migrations.test_operations.OperationTests.test_alter_field_change_nullable_to_decimal_database_default_not_null',
'migrations.test_operations.OperationTests.test_alter_field_change_nullable_to_decimal_database_default_not_null', # noqa
},
"Snowflake: Invalid column default expression [PI()].": {
'migrations.test_operations.OperationTests.test_add_field_database_default_function',
Expand Down
4 changes: 3 additions & 1 deletion django_snowflake/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ def get_table_description(self, cursor, table_name):
)
for (
name, data_type, kind, null, default, pk, unique_key, check,
expression, comment, policy_name,
# *_ ignores policy_name, privacy_domain, and any future
# columns in DESCRIBE TABLE output.
expression, comment, *_
) in table_info
]

Expand Down

0 comments on commit 5ecf3e5

Please sign in to comment.