Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix named-tuple params that also appear in the schema #5964

Merged
merged 1 commit into from Aug 30, 2023

Conversation

msullivan
Copy link
Member

The tuple argument decoder code simply ignores whether a tuple is
named, figuring that named tuples and unnamed tuples have the same
representation in the generated SQL, so why bother. (It was called out
as a "HACK" in the comments.)

But they only have the same representation when they are represented
as a record. If the tuple type appears in the schema, it gets
represented as a named composite type and we no longer have the right
representation.

Just do it right. Fixes #5789.

The tuple argument decoder code simply ignores whether a tuple is
named, figuring that named tuples and unnamed tuples have the same
representation in the generated SQL, so why bother. (It was called out
as a "HACK" in the comments.)

But they only have the same representation when they are represented
as a `record`. If the tuple type appears in the schema, it gets
represented as a named composite type and we no longer have the right
representation.

Just do it right. Fixes #5789.
@msullivan msullivan merged commit 80d4322 into master Aug 30, 2023
21 checks passed
@msullivan msullivan deleted the named-tuple-args branch August 30, 2023 20:36
msullivan added a commit that referenced this pull request Sep 2, 2023
The tuple argument decoder code simply ignores whether a tuple is
named, figuring that named tuples and unnamed tuples have the same
representation in the generated SQL, so why bother. (It was called out
as a "HACK" in the comments.)

But they only have the same representation when they are represented
as a `record`. If the tuple type appears in the schema, it gets
represented as a named composite type and we no longer have the right
representation.

Just do it right. Fixes #5789.
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.

Named tuple params whose types also appear in the schema don't work
3 participants