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 collisions between function parameters named id and the property #6000

Merged
merged 2 commits into from Sep 1, 2023

Conversation

msullivan
Copy link
Member

We name function params their actual names, which can collide with the
id column in tables and produce bad results. It could maybe collide
with source and target in link tables too. It doesn't collide with
everything, because most columns get uuid names.

Qualify references to params with the function name.

Fixes #5935.

We name function params their actual names, which can collide with the
`id` column in tables and produce bad results. It could maybe collide
with source and target in link tables too. It doesn't collide with
everything, because most columns get uuid names.

Qualify references to params with the function name.

Fixes #5935.
@@ -57,7 +57,7 @@ def compile_ir_to_sql_tree(
ignore_shapes: bool = False,
explicit_top_cast: Optional[irast.TypeRef] = None,
singleton_mode: bool = False,
use_named_params: bool = False,
use_named_params: Optional[tuple[str, ...]] = None,
Copy link
Member

Choose a reason for hiding this comment

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

Should we rename the arg to "named_arg_prefix" or something?

@msullivan msullivan merged commit 098f6bd into master Sep 1, 2023
21 checks passed
@msullivan msullivan deleted the id-func-collide branch September 1, 2023 03:03
msullivan added a commit that referenced this pull request Sep 2, 2023
…6000)

We name function params their actual names, which can collide with the
`id` column in tables and produce bad results. It could maybe collide
with source and target in link tables too. It doesn't collide with
everything, because most columns get uuid names.

Qualify references to params with the function name.

Fixes #5935.
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.

Parameter name conflicting with property name
2 participants