-
Notifications
You must be signed in to change notification settings - Fork 1
Fix more type hint #1
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
base: fix-type-hint
Are you sure you want to change the base?
Conversation
|
Hello uf-fipper, I am happy to review (and merge) your changes in the following days. Ping me if you want to add more commits. |
|
Thanks for your reply! I am looking forward to our cooperation. |
fix python3.6 support fix builder overload add ignore_copy type hint fix validate type hint
fix python3.6 support fix builder overload add ignore_copy type hint fix validate type hint
add wrap_constant's overload change wrap_constant's value type: Node -> Term add wrap_json's overload remove Term._assert_guard add get_formatted_value's return type add python3.6, 3.7, 3.8, 3.9 support (Case.__init__) change WindowFrameAnalyticFunction.Edge.modifier default value fix other type
add wrap_constant's overload change wrap_constant's value type: Node -> Term add wrap_json's overload remove Term._assert_guard add get_formatted_value's return type add python3.6, 3.7, 3.8, 3.9 support (Case.__init__) change WindowFrameAnalyticFunction.Edge.modifier default value fix other type
Selectable: change Base Type: Node -> Term Table: add generic type Query: add generic type __copy__: return Self type remove Term._assert_guard Joiner: add generic type fix other type
Selectable: change Base Type: Node -> Term Table: add generic type Query: add generic type __copy__: return Self type remove Term._assert_guard Joiner: add generic type fix other type
add Query generic __copy__: return Self type change classmethod first argument: self -> cls fix bug: in queries.make_tables
add Query generic __copy__: return Self type change classmethod first argument: self -> cls fix bug: in queries.make_tables
e85e6ba to
3c0be4c
Compare
|
uf-fipper, would you like to rewrite all your commits for a different email address? Looks like it is not asscoicated to any account on GitHub. Also: I had been added an automated test for type checking, so I rebase commits for you. |
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 fine for me, but your commits are commited by fish <fish@fish.fish>. Would you like to rewrite them to your own identity?
Also: you may run black on your code, so we can fix the format problem.
|
I changed my email in the latest commit, and I reformat file using black. |
05d5de9 to
6338289
Compare
| ... | ||
|
|
||
| @staticmethod | ||
| def wrap_json( |
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.
The wrap_json()'s overloads are reported by mypy:
- Overloaded function signatures 1 and 6 overlap with incompatible return types [misc]
- Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader [misc]
- (Rubicon: This signature might be removed since the TermT is including IntervalT,
Intervalis already aTerm)
- (Rubicon: This signature might be removed since the TermT is including IntervalT,
- Overloaded function signatures 2 and 6 overlap with incompatible return types [misc]
- Overloaded function signatures 3 and 6 overlap with incompatible return types [misc]
- Overloaded function signatures 4 and 6 overlap with incompatible return types [misc]
- Overloaded function signatures 5 and 6 overlap with incompatible return types [misc]
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.
The rest errors are looked like they could not be solved with a workaround, may you leave a comment there as a tip?
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 used mypy to check my code, but I found more issues such as generics, and the "default" parameter in TypeVar. I need to look into these issues over the next few days. Before that, I used pyright (basic mode) to check my code. I'm sorry about that.
|
Hi thislight, I used mypy to recheck the code and added some type ignore. However, during the test, I found another problem: in the version of python 3.8+, use |
fix type hint
utils.py
builderoverloadignore_copytype hintvalidatetype hintterms.py
wrap_constantoverloadwrap_constantvalue type:Node->Termwrap_jsonoverloadTerm._assert_guardget_formatted_valuereturn typeCase.__init__)WindowFrameAnalyticFunction.Edge.modifierdefault valueTerm.anyTerm.all: fix return typequeries.py
Selectable: change Base Type:Node->TermTable: add generic typeQuery: add generic type__copy__: returnSelftypeTerm._assert_guardJoiner: add generic typedialects.py
Querygeneric__copy__: returnSelftypeclassmethodfirst argument:self->clsqueries.make_tablesarray.py search_string.py type_conversion.py
OptionalandSchematypeabout generic