Skip to content

Chore: fix mypy type hints, function prototypes to get parity with sqlglot#901

Merged
georgesittas merged 1 commit intomainfrom
jo/type_fixups
May 25, 2023
Merged

Chore: fix mypy type hints, function prototypes to get parity with sqlglot#901
georgesittas merged 1 commit intomainfrom
jo/type_fixups

Conversation

@georgesittas
Copy link
Copy Markdown
Collaborator

No description provided.

@georgesittas georgesittas requested review from a team, eakmanrq and izeigerman May 25, 2023 17:17
Comment on lines -76 to +75
meta = self._parse_wrapped(lambda: parser(self))
meta = self._parse_wrapped(lambda: t.cast(t.Callable, parser)(self))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I couldn't figure out why mypy wouldn't recognize parser as a Callable here..

Comment on lines -347 to +345
expression = expression.replace(exp.alias_(expression.copy(), expression.name))
expression = expression.replace(exp.alias_(expression, expression.name))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The alias_ helper copies by default now.

@georgesittas
Copy link
Copy Markdown
Collaborator Author

The type: ignores were needed because __parse... methods aren't recognized in the Parser due to setattr in _override_sqlglot.

@georgesittas georgesittas merged commit 598dfbd into main May 25, 2023
@georgesittas georgesittas deleted the jo/type_fixups branch May 25, 2023 17:35
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.

2 participants