Skip to content

Conversation

@arw2019
Copy link
Contributor

@arw2019 arw2019 commented Dec 17, 2020

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry
chunksize: Optional[str],
columns,
coerce_float: bool = True,
parse_dates=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

is this one correct? parse_dates

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually didn't touch this, but looking through these read_sql methods parse_dates defaults to None in most (I think all) of those

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe i pointed at the wrong one, this shouldn't be a bool type for parse_dates right? it takes a Optional[Dict[str, ....]]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes it's one up from here.

Fixed (removed the annotation - sticking to doing plain bool/str in this PR)

@jreback jreback added the Typing type annotations, mypy/pyright type checking label Dec 17, 2020
pandas/io/sql.py Outdated


def _handle_date_column(col, utc=None, format=None):
def _handle_date_column(col, utc: Optional[bool] = None, format: Optional[str] = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

format is not right, itls something like Optional[Union[Dict[str, str], str]]

Copy link
Contributor Author

@arw2019 arw2019 Dec 19, 2020

Choose a reason for hiding this comment

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

yes definitely a mistake

I think it has to be Optional[Dict[str, Any]] because it ends up in

to_datetime(col, errors=error, **format) 

Can also be str

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed the fix

@jreback jreback added this to the 1.3 milestone Dec 21, 2020
@jreback jreback merged commit de3eef9 into pandas-dev:master Dec 21, 2020
@jreback
Copy link
Contributor

jreback commented Dec 21, 2020

thanks @arw2019

luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Typing type annotations, mypy/pyright type checking

2 participants