-
Notifications
You must be signed in to change notification settings - Fork 157
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
Remove unnecessary cast() in csv_data.py (2) #798
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
junholee6a
requested review from
JGSweets,
ksneab7,
taylorfturner,
micdavis and
tyfarnan
as code owners
April 26, 2023 21:06
Will need to update branch @junholee6a |
junholee6a
force-pushed
the
remove-cast-2
branch
from
April 26, 2023 21:24
44ab955
to
899c220
Compare
- Removing this cast() doesn't cause a mypy error - self.file_encoding has type Optional[str] prior to casting - The read_csv_df function’s encoding parameter also has type Optional[str] - Therefore casting to str for the function call isn’t necessary
taylorfturner
approved these changes
Apr 26, 2023
JGSweets
approved these changes
Apr 27, 2023
@junholee6a maybe push an empty commit again... the |
@taylorfturner looks like it worked, thank you for the help! |
tyfarnan
pushed a commit
that referenced
this pull request
Apr 27, 2023
* Encode update format (#789) * Update categorical test * Fix encode tests to agree with new JSONEncoder Fix categorical column tests Fix DateTimeColumn tests Fix IntColumn tests Fix NumericStatsMixin tests Fix OrderColumn tests Fix BaseColumn tests * Remove unnecessary cast() in csv_data.py (1) (#796) Removing this cast() doesn't cause a mypy error. self._header is set to type Optional[Union[str, int]] in the constructor. Also, self.guess_header_row() has return type Optional[int], so casting to int doesn't make sense here. * Remove unnecessary cast() in csv_data.py (2) (#798) --------- Co-authored-by: Kshitij Sinha <[email protected]> Co-authored-by: Junho Lee <[email protected]>
tyfarnan
pushed a commit
that referenced
this pull request
Apr 27, 2023
* Fixed testing to run on all feature branches for PRs (#793) * cleanup time sapce analysis code (#797) * quick update to feature/memory-optimization for merge to `main` (#802) * Encode update format (#789) * Update categorical test * Fix encode tests to agree with new JSONEncoder Fix categorical column tests Fix DateTimeColumn tests Fix IntColumn tests Fix NumericStatsMixin tests Fix OrderColumn tests Fix BaseColumn tests * Remove unnecessary cast() in csv_data.py (1) (#796) Removing this cast() doesn't cause a mypy error. self._header is set to type Optional[Union[str, int]] in the constructor. Also, self.guess_header_row() has return type Optional[int], so casting to int doesn't make sense here. --------- Co-authored-by: Kshitij Sinha <[email protected]> Co-authored-by: Junho Lee <[email protected]> * Update feat mem (#803) * Encode update format (#789) * Update categorical test * Fix encode tests to agree with new JSONEncoder Fix categorical column tests Fix DateTimeColumn tests Fix IntColumn tests Fix NumericStatsMixin tests Fix OrderColumn tests Fix BaseColumn tests * Remove unnecessary cast() in csv_data.py (1) (#796) Removing this cast() doesn't cause a mypy error. self._header is set to type Optional[Union[str, int]] in the constructor. Also, self.guess_header_row() has return type Optional[int], so casting to int doesn't make sense here. * Remove unnecessary cast() in csv_data.py (2) (#798) --------- Co-authored-by: Kshitij Sinha <[email protected]> Co-authored-by: Junho Lee <[email protected]> --------- Co-authored-by: ksneab7 <[email protected]> Co-authored-by: Kshitij Sinha <[email protected]> Co-authored-by: Junho Lee <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: #717
cast()
doesn't cause a mypy errorself.file_encoding
has typeOptional[str]
prior to castingread_csv_df
function’sencoding
parameter also has typeOptional[str]
str
for the function call isn’t necessary