-
Notifications
You must be signed in to change notification settings - Fork 4
Support for PdReader kwargs #8
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
Conversation
|
What about having some common params across all methods instead of just wrapping via kwargs? E.g. columns selection make sense for all listed reader methods imo. This is supported in |
| Behaviour can be customised via passing any kwargs to the constructor. | ||
| """ | ||
|
|
||
| def __init__(self, input_format=InputFormat.AUTO, **pdread_kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we will extend the signature in the future? I would rather not, but it's one of the reason why I do not like this kind of kwargs propagation that might be a bit dangerous sometimes... (although we use it quite often 😃 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely agree and I in general not use kwargs myself. But as the evil down there is already in place, what can I do 🤷
Idea I toyed with and which may end up to the next version is to require the user to provide directly the read_single function, thus leaving the user fully in control of the kwargs passing. I did not use it now as it would require user do what feels like boilerplate. So once we'll get to a situation where the signature needs to be extended too much, we may escape via this way, possibly keeping some of the previous functionality via some utils or factories or builders
I'm not really worried by it because the core thing that must stay is the DataReader interface which is not tainted by this at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about a case when the signature extension might introduce some breaking changes, especially because of used kwargs. But let's not complicate it atm.
that would, in my eyes, be too much -- the fsql should be as independent and uncoupled from pandas as possible. What you describe would couple the interface of pd.read to the interface of PandasReader, which imo would be unhealthy. I can imagine a different project (or possibly some |
No description provided.