-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enable Mypy lint #593
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
Enable Mypy lint #593
Conversation
0f9311d
to
25a52e7
Compare
/assign @woop |
/assign @khorshuheng |
/assign @zhilingc |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: imjuanleonard The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
sdk/python/feast/job.py
Outdated
@@ -172,8 +173,11 @@ def to_chunked_dataframe( | |||
pd.DataFrame: | |||
Pandas DataFrame of the feature values. | |||
""" | |||
|
|||
# Object is Avro row type object, refer to self.result function for this type | |||
records: List[object] = [] |
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.
Why are you using object instead of the type?
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 idea was:
- The Avro Row will be populated to object thus overriding the type
- The records don't call any method, it is just being passed around, so it is safe
- After checking all the tests pass (need to tests for the e2e as well thought)
- I cannot find what is AvroRow filetype, do you know?
I have tried to dig deeper into the class until I found it was reading only fromargs
andkwargs
without return type, is it byte?
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.
Types are there to add safety. It seems like you are looking for a shortcut here.
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.
Okay, let me try to simulate this function call to Avro row, and print the type, let me see what is the type.
Although I am certain object should be sufficient, we can see the type to make sure
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.
Although I am certain object should be sufficient
Sufficient to do what?
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.
Sufficient to do what?
O yeah, the object is not sufficient, I thought it will inherit everything, but it doesn't allow you to inherit the function as well until typecasted.
I just checked it out, the fastreader.reader will return List of dict
hence, have rebased the commit.
Thanks
6a543de
to
f3263ef
Compare
436cb0a
to
39179d6
Compare
Closing in favor of #749 |
What this PR does / why we need it:
Will help to know the type of functions explicitly
Which issue(s) this PR fixes:
Fixes #594
Does this PR introduce a user-facing change?: