Skip to content

Chore!: bump sqlglot to v21.0.0#2101

Merged
georgesittas merged 1 commit intomainfrom
jo/bump_sqlglot_21_0_0
Feb 7, 2024
Merged

Chore!: bump sqlglot to v21.0.0#2101
georgesittas merged 1 commit intomainfrom
jo/bump_sqlglot_21_0_0

Conversation

@georgesittas
Copy link
Collaborator

@georgesittas georgesittas commented Feb 7, 2024

Was super annoying to detect the need for the L458 change in schema_diff.py (triggered by a recent change in sqlglot), may need to refactor this at some point to avoid the mutations if possible.

@georgesittas georgesittas requested a review from tobymao February 7, 2024 14:48
@CLAassistant
Copy link

CLAassistant commented Feb 7, 2024

CLA assistant check
All committers have signed the CLA.

new_kwarg: exp.ColumnDef,
) -> t.List[TableAlterOperation]:
current_type = exp.DataType.build(current_type)
# We don't copy on purpose here because current_type may need to be mutated inside
Copy link
Contributor

Choose a reason for hiding this comment

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

why does data.build mutate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It doesn't mutate, it copies current_type which caused an issue in this module because we are mutating the struct expression in several places (search for .pop and .insert calls, as mentioned in the comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so before my sqlglot commit we weren't copying inside DataType.build and this worked because the mutations were being propagated here, now that we copy they don't unless I switch it off here

@georgesittas georgesittas merged commit 45ca838 into main Feb 7, 2024
@georgesittas georgesittas deleted the jo/bump_sqlglot_21_0_0 branch February 7, 2024 17:16
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