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

read_sql_table - datetime index fix and index type checking #4474

Merged
merged 5 commits into from Feb 26, 2019

Conversation

Projects
None yet
2 participants
@jcorb
Copy link
Contributor

commented Feb 11, 2019

Fixes #4289

Also added a type check on the index column if divisions is None. It will raise a TypeError if the index column's dtype.kind is not in ['i', 'u', 'f'] or equal to M

  • Tests added / passed
  • Passes flake8 dask
@martindurant

This comment has been minimized.

Copy link
Member

commented Feb 12, 2019

Could you please add a test, in which a text column is chosen, and so it raises the exception?

@jcorb

This comment has been minimized.

Copy link
Contributor Author

commented Feb 13, 2019

Yes, sure thing. I presume it would sit in here dask/dask/dataframe/io/tests/test_sql.py?

@martindurant

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

Yes exactly

@jcorb

This comment has been minimized.

Copy link
Contributor Author

commented Feb 26, 2019

apologies for the delay - I have added a test which sets the index column to be a character column and checks for the TypeError exception.

(first time I have written that sort of test, so I just mimicked what was in there already - hopefully it is along the right lines)

@martindurant

This comment has been minimized.

Copy link
Member

commented Feb 26, 2019

Looks good, except lint:

dask/dataframe/io/tests/test_sql.py:266:84: W292 no newline at end of file
@jcorb

This comment has been minimized.

Copy link
Contributor Author

commented Feb 26, 2019

Ah, missed that step - should be good now.

@martindurant martindurant merged commit 6ecbb0c into dask:master Feb 26, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@martindurant

This comment has been minimized.

Copy link
Member

commented Feb 26, 2019

Thank you.

@jrbourbeau jrbourbeau referenced this pull request Apr 17, 2019

Merged

Remove file "test" #4710

0 of 2 tasks complete

jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this pull request May 14, 2019

read_sql_table - datetime index fix and index type checking (dask#4474)
* switched /npartitions and total_seconds()

* added check for type before creating divisions

* removed comments

* added test for character index type error

* added blank line at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.