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

Add ability to get local columns from wrapped functions #74

Merged
merged 4 commits into from
Jul 29, 2014

Conversation

jiffyclub
Copy link
Member

The .local_columns attribute on all wrapped tables should now work.
On wrapped functions (both tables and sources), it will evaluate the
function, store frame metadata, and return the frame columns.

For table sources this will also cause the registered table source to be replaced with the data frame, but now the function wrapper object will have working .columns, .local_columns, .index, and len() capabilities.

The .local_column attribute on all wrapped tables should now work.
On wrapped functions (both tables and sources), it will evaluate the
function, store frame metadata, and return the frame columns.
The .convert method evaluates the wrapped function, registers the
DataFrame under the same name, and returns the new wrapped DataFrame.
These are going to be commonly used by users so they shouldn't
be hidden as private classes in the sim module.
@jiffyclub
Copy link
Member Author

@fscottfoti You might also find the .convert method on TableSourceWrapper useful. It'll evaluate the source function and return the newly created DataFrameWrapper.

jiffyclub added a commit that referenced this pull request Jul 29, 2014
Add ability to get local columns from wrapped functions
@jiffyclub jiffyclub merged commit c53635a into master Jul 29, 2014
@jiffyclub jiffyclub deleted the table-func-upgrades branch July 29, 2014 23:24
@fscottfoti
Copy link
Contributor

The convert method is handy. Is the right way to use it to call

if isinstance(df, TableSourceWrapper):
    df = df.convert()

I'm curious, why not convert when injected so that no TableSourceWrapper ever gets injected? I mean, once it's injected presumably it will need to be read in so why not convert beforehand?

@jiffyclub
Copy link
Member Author

Yeah that's a good idea.

On Tuesday, July 29, 2014, Fletcher Foti notifications@github.com wrote:

The convert method is handy. Is the right way to use it to call

if isinstance(df, TableSourceWrapper):
df = df.convert()

I'm curious, why not convert when injected so that no TableSourceWrapper
ever gets injected? I mean, once it's injected presumably it will need to
be read in so why not convert beforehand?


Reply to this email directly or view it on GitHub
#74 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants