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

BUG: resolvers in pandas.eval should accept list-like #14095

Closed
sdementen opened this issue Aug 27, 2016 · 4 comments
Closed

BUG: resolvers in pandas.eval should accept list-like #14095

sdementen opened this issue Aug 27, 2016 · 4 comments
Labels
Milestone

Comments

@sdementen
Copy link
Contributor

I think the resolvers argument of pandas.eval requires a tuple and not a list

resolvers : list of dict-like or None, optional
A list of objects implementing the __getitem__ special method that you can use to inject an additional collection of namespaces to use for variable lookup. For example, this is used in the query() method to inject the index and columns variables that refer to their respective DataFrame instance attributes.

as with a list I get a

    kwargs['resolvers'] = kwargs.get('resolvers', ()) + resolvers
TypeError: can only concatenate tuple (not "list") to tuple
@chris-b1
Copy link
Contributor

Yes, although rather than changing the docs, it should be pretty straightforward to convert any list-like into a tuple.

Probably here and somewhere around here

@jreback jreback added this to the Next Major Release milestone Aug 27, 2016
@jreback jreback changed the title error in documentation for resolvers in pandas.eval BUG: resolvers in pandas.eval should accept list-like Aug 27, 2016
@jreback
Copy link
Contributor

jreback commented Aug 27, 2016

note that this is in reality a 'private'-ish kw, not sure what an outside of pandas user would do with it.

@sdementen
Copy link
Contributor Author

For the use case, I use it to transform timeseries according to expressions given by the user and I want to add some "variables" that are columns of specific dataframes (a bit like the query method)

@tom-bird
Copy link
Contributor

I'll have a look at fixing

@jreback jreback modified the milestones: 0.19.0, Next Major Release Aug 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants