-
Notifications
You must be signed in to change notification settings - Fork 41
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
Improve Public Interface Types #172
Conversation
@@ -187,9 +190,9 @@ class Timing(_Primitive): | |||
class Condition: | |||
"""For specifying free-form SQL in the condition of a trigger.""" | |||
|
|||
sql: str = None | |||
sql: str | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming you'll need to use Union
for 3.8 compat, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, since I added from __future__ import annotations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use it in earlier versions when type annotations are stringified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, I should convert this elsewhere. I do believe there is a py3.8 bug if you check circle though
File "/code/pgtrigger/runtime.py", line 154, in <module>
def ignore(*uris: str, databases: Union[List[str], None] = None) -> Generator[None]:
TypeError: 'ABCMeta' object is not subscriptable```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, had to add a future imports for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good once tests pass
Some minor improvements to the public interface types. The main QoL improvement is probably going to be fixing type-checking when passing in unioned/intersected
pgtrigger.Q
instances.