Skip to content

CLN: explicit kwargs for select #29977

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

Merged
merged 1 commit into from
Dec 2, 2019

Conversation

jbrockmendel
Copy link
Member

Questions for @jreback on follow-ups:

  1. Note in read_hdf kwargs is still present in the signature, but i put an assertion that they are empty. In principle we could pass more junk to HDFStore, but we never do in tests. Should we allow it, or can those kwargs be deleted altogether?

  2. the current signature for select_column is (self, key: str, column: str, **kwargs). These kwargs are passed to read_column, which would accept "where", "start", "stop". In tests we pass start and stop, but never where. Can we rule out "where"?

@jreback
Copy link
Contributor

jreback commented Dec 2, 2019

Questions for @jreback on follow-ups:

  1. Note in read_hdf kwargs is still present in the signature, but i put an assertion that they are empty. In principle we could pass more junk to HDFStore, but we never do in tests. Should we allow it, or can those kwargs be deleted altogether?
  2. the current signature for select_column is (self, key: str, column: str, **kwargs). These kwargs are passed to read_column, which would accept "where", "start", "stop". In tests we pass start and stop, but never where. Can we rule out "where"?

IIRC I answered 1) elsewhere. we pass on kwargs in the constructor to .open_file; these are keywords that are used in the construction deep in PyTables for how to open the backends, e.g.https://www.pytables.org/cookbook/inmemory_hdf5_files.html, e.g. you could pass driver= and it would work.

  1. yes I think you can remove where

@jreback jreback added the IO HDF5 read_hdf, HDFStore label Dec 2, 2019
@jreback jreback added this to the 1.0 milestone Dec 2, 2019
columns=None,
iterator=False,
chunksize: Optional[int] = None,
**kwargs,
Copy link
Contributor

Choose a reason for hiding this comment

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

a solution to this would be to remove kwargs and instead add a keyword backend_kwargs={} or driver_kwargs={}

Copy link
Member Author

Choose a reason for hiding this comment

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

that would work, will need deprecation cycle, and im all about removing deprecations these days

Copy link
Member Author

Choose a reason for hiding this comment

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

for now ill need to make a quick PR reverting the assert not kwargs this introduced

@jreback jreback merged commit 42a280b into pandas-dev:master Dec 2, 2019
@jreback
Copy link
Contributor

jreback commented Dec 2, 2019

suggestion for a way out to remove the kwargs arg in read_hdf & HDFStore

@jbrockmendel jbrockmendel deleted the cln-pytables-kwargs-select branch December 2, 2019 23:44
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO HDF5 read_hdf, HDFStore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants