-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start from dataset schema for lightweight python component
consumes
(…
…#789) Fixes #785 Opening this as a draft PR since it's not yet clear to me what the desired behavior is. I'll be using the "inner" / "outer" terminology which we already use in our `OperationSpec` class to explain. "inner" schema's are the schema's that the Python component consumes / produces. "outer" schema's are the schema's that the `DataIO` layer consumes / produces. For docker components, the logic works as follows: 1. The `consumes` section in the component spec is the "inner" schema 2. We leverage the `consumes` argument of the `apply` method to calculate the "outer" schema from the "inner" schema. For lightweight python components, we do not have a component spec to start from. So what I currently implemented is this: 1. We start from the dataset schema and reverse alter it with the `consumes` argument to calculate the "inner" schema. 2. We leverage the `consumes` argument of the `apply` method to calculate the "outer" schema from the "inner" schema. This works, but has one big downside. Since we start from the dataset schema, the calculated "inner" / "outer" consumes contain all the fields in the dataset. In other words, the lack of a component spec removes the ability to select which columns from the dataset to load. Since this is an important part of our optimization, I think we need to find a way around this. My best idea at this time is to expand the `lightweight_component` decorator to add support for this. But curious to hear if anyone has other ideas. --------- Co-authored-by: Philippe Moussalli <[email protected]> Co-authored-by: Georges Lorré <[email protected]>
- Loading branch information
1 parent
115fe9f
commit 9070b82
Showing
6 changed files
with
271 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.