ENH: Add a data_preload step in pandas backend #1142
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a
data_preloadstep to the execution pipeline for the Pandasbackend.
The motivation for this is to allow clients to perform operations on
(Node, ConcreteData)pairs (including ascopeargument) before the executionfor a particular operation starts.
Custom data source execution is the main use case here.
As a motivating example, consider a custom data source object that can be
turned into a DataFrame.
We want to be able to operate on our custom data source, but we don't want to
redefine every operation for this data source, or it doesn't make sense to
define operations on this custom object directly.
data_preloadgives the ability to call a function on data pieces that are in scope before any execution happens. In the example above,data_preloadwould turn theConcreteDataobject into apandas.DataFrame.The default behavior is no-op.
This also sets the stage for multi-client execution. More on that to come.