Skip to content
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 2 commits into from
Apr 27, 2023

Conversation

junholee6a
Copy link
Contributor

Issue: #717

  • 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
Copy link
Contributor

Will need to update branch @junholee6a

- 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 taylorfturner enabled auto-merge (squash) April 26, 2023 21:41
@taylorfturner
Copy link
Contributor

@junholee6a maybe push an empty commit again... the license/cla is still in "expected" status. you can do git commit -m "empty commit" --allow-empty

@taylorfturner taylorfturner added the static_typing mypy static typing issues label Apr 27, 2023
@junholee6a
Copy link
Contributor Author

@taylorfturner looks like it worked, thank you for the help!

@taylorfturner taylorfturner merged commit 23da09d into capitalone:main Apr 27, 2023
5 checks passed
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 <55467782+kshitijavis@users.noreply.github.com>
Co-authored-by: Junho Lee <53921230+junholee6a@users.noreply.github.com>
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 <55467782+kshitijavis@users.noreply.github.com>
Co-authored-by: Junho Lee <53921230+junholee6a@users.noreply.github.com>

* 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 <55467782+kshitijavis@users.noreply.github.com>
Co-authored-by: Junho Lee <53921230+junholee6a@users.noreply.github.com>

---------

Co-authored-by: ksneab7 <91956551+ksneab7@users.noreply.github.com>
Co-authored-by: Kshitij Sinha <55467782+kshitijavis@users.noreply.github.com>
Co-authored-by: Junho Lee <53921230+junholee6a@users.noreply.github.com>
@junholee6a junholee6a deleted the remove-cast-2 branch April 28, 2023 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
static_typing mypy static typing issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants