Skip to content

Conversation

@henadzit
Copy link
Contributor

@henadzit henadzit commented Dec 4, 2024

  • Removed unused ignores for wrap_constant
  • Simplify typing of wrap_json
  • Make Interval a subclass of Term. It doesn't seem like there is reason it should be a subclass of Node. This helps with simplifying typing.
  • Set warn_unused_ignores = true for mypy and remove unused ignores

@henadzit henadzit marked this pull request as ready for review December 4, 2024 15:49
@henadzit henadzit requested a review from waketzheng December 4, 2024 15:49
@waketzheng
Copy link
Contributor

Great! Looks nice, the only thing is that Interval is not a subclass of Term, please check it.

@henadzit
Copy link
Contributor Author

henadzit commented Dec 5, 2024

Great! Looks nice, the only thing is that Interval is not a subclass of Term, please check it.

Could you please elaborate on what you mean? I couldn't figure out why the Interval should be a subclass of Node in particular. It seems to work just fine with it being a subclass of Term.

@waketzheng
Copy link
Contributor

https://github.com/tortoise/pypika-tortoise/pull/21/files#diff-54340751c88780ef96f3ba11bb105a16d92a43a583141992cc7e4162507ac013L107

You change if isinstance(val, (Term, QueryBuilder, Interval)): to if isinstance(val, Term):
QueryBuilder is subclass of Term, while Interval is not. So these two line have different logic.

Copy link
Contributor

@waketzheng waketzheng left a comment

Choose a reason for hiding this comment

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

Please fix conflicts

@waketzheng waketzheng merged commit 3966bc1 into tortoise:main Jun 3, 2025
5 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.

2 participants