Skip to content

Fix crash on quoted anonymous function names - #690

Merged
macbre merged 3 commits into
macbre:masterfrom
illes:fix/quoted-anonymous-function-name
Oct 2, 2026
Merged

macbre merged 3 commits into
macbre:masterfrom
illes:fix/quoted-anonymous-function-name

Conversation

@illes

@illes illes commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

A quoted function name like "timezone"(...) makes exp.Anonymous.this an Identifier, so the date-part check crashed calling .lower() on it. It now uses .name, which is a str for both forms. The first commit adds the regression test.

Resolves #688.

🤖 Generated with Claude Code

illes and others added 2 commits September 30, 2026 10:05
Reproduces macbre#688: a quoted function name such as "timezone"(...) crashes
column extraction with AttributeError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
exp.Anonymous.this is an Identifier when the function name is quoted,
so calling .lower() on it raised AttributeError. Use .name, which
sqlglot normalises to a str for both forms.

Resolves macbre#688.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@macbre macbre left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks!

@macbre
macbre merged commit 195a079 into macbre:master Oct 2, 2026
11 checks passed
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.0.1 raises AttributeError on date_trunc('DAY', "timezone"(...))

2 participants