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

[FEATURE] Better support for class member as extensions #58

Closed
goodwanghan opened this issue Sep 30, 2020 · 2 comments · Fixed by #74
Closed

[FEATURE] Better support for class member as extensions #58

goodwanghan opened this issue Sep 30, 2020 · 2 comments · Fixed by #74
Labels
Milestone

Comments

@goodwanghan
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
The piece of code describes the problem

import pandas as pd
from fugue_sql import FugueSQLWorkflow

class Test(object):
    # schema: *
    def t(self, df:pd.DataFrame) -> pd.DataFrame:
        return df
    
test = Test()

with FugueSQLWorkflow() as dag:
    dag.df([[0]],"a:int").transform(test.t).show() # this works

f = test.t

with FugueSQLWorkflow() as dag:
    dag("""
    CREATE [[0]] SCHEMA a:int
    TRANSFORM USING f   # this works
    PRINT
    """)
    
with FugueSQLWorkflow() as dag:
    dag("""
    CREATE [[0]] SCHEMA a:int
    TRANSFORM USING test.t   # this complains test.t is not a valid transformer
    PRINT
    """)

Describe the solution you'd like
TRANSFORM USING test.t should work, test.t should be recognized
This is not a problem of fugue, but a problem of triad
https://github.com/fugue-project/triad/blob/84d1f01be413251a5a85ce89025c982e1306ed70/triad/utils/convert.py#L155
It needs improvement in triad to be able to recognize this expression.
On Fugue side, additional tests should be added to test class member as extension scenarios

Describe alternatives you've considered
The alternative is the second example this the code above

Additional context
NA

@goodwanghan goodwanghan added enhancement New feature or request unit test labels Sep 30, 2020
@goodwanghan goodwanghan added this to the 0.4.2 milestone Sep 30, 2020
@goodwanghan goodwanghan changed the title [FEATURE] Better support for extensions in a class [FEATURE] Better support for class member as extensions Sep 30, 2020
@goodwanghan
Copy link
Collaborator Author

fugue-project/triad#52

@goodwanghan goodwanghan linked a pull request Oct 7, 2020 that will close this issue
@goodwanghan
Copy link
Collaborator Author

The Triad change is causing behavioral change on string parsing, so this becomes a high priority item to fix

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.

1 participant