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

Added static typing to data_readers/data_utils.py #658

Closed
wants to merge 1 commit into from

Conversation

Sanketh7
Copy link
Contributor

Copy link
Contributor

@taylorfturner taylorfturner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 main comments

@@ -15,10 +17,10 @@
from .. import dp_logging
from .filepath_or_buffer import FileOrBufferHandler, is_stream_buffer # NOQA

logger = dp_logging.get_child_logger(__name__)
logger: Logger = dp_logging.get_child_logger(__name__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you import annotations from __futures__ can you not import the Logger here?

@@ -1,10 +1,12 @@
"""Contains functions for data readers."""
import json
from logging import Logger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be able to get rid of this with annotations import from __futures__

@@ -299,13 +301,14 @@ def read_csv_df(

# if the buffer was wrapped, detach it before returning
if is_buf_wrapped:
assert isinstance(file_path, TextIOWrapper)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code change: is this required by mypy?

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.

2 participants