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

[Core feature] [flytekit] Revisit StructuredDatasetDecoder interface #2099

Closed
2 tasks done
wild-endeavor opened this issue Jan 25, 2022 · 0 comments
Closed
2 tasks done
Assignees
Labels
enhancement New feature or request flytekit FlyteKit Python related issue

Comments

@wild-endeavor
Copy link
Contributor

wild-endeavor commented Jan 25, 2022

Flytekit StructuredDatasetDecoder Interface

The current interface for the StructuredDatasetDecoder looks like

    def decode(
        self,
        ctx: FlyteContext,
        flyte_value: literals.StructuredDataset,
    ) -> Union[DF, Generator[DF, None, None]]:

This served our purposes fine until we realized in #822 that there were situations where the type information (or the encapsulating Metadata object rather) was more specific than in the incoming literal.

For example, if you have tasks

def t1() -> pd.DataFrame: ...
def t2(in1: Annotated[pd.DataFrame, kwtypes(col_a=int)]): ...

where t2(in1=t1()) then when t2 runs and attempts to decode the incoming literal, it actually has more information than the incoming literal.

Currently the code will just overwrite the metadata inside the literal, but should we leave that be and add an optional parameter to the decoder interface? current_task_metadata: Optional[StructuredDatasetMetadata] = None

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@wild-endeavor wild-endeavor added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels Jan 25, 2022
@wild-endeavor wild-endeavor added the flytekit FlyteKit Python related issue label Feb 23, 2022
@wild-endeavor wild-endeavor added this to the 0.19.3 - Feb 2021 milestone Feb 24, 2022
@wild-endeavor wild-endeavor removed the untriaged This issues has not yet been looked at by the Maintainers label Feb 24, 2022
@pingsutw pingsutw self-assigned this Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request flytekit FlyteKit Python related issue
Projects
None yet
Development

No branches or pull requests

2 participants