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

Enables the materializers to depend on functions & driver variables #431

Merged

Commits on Oct 5, 2023

  1. Enables the materializers to depend on functions & driver variables

    .execute() enables that. The materializers should also be able to handle it.
    
    The complication however is on who knows what and when to do it.
    So I made the decision to make the driver sanitize the materializers given
    the context that it has. New objects are returned so we don't modify the underlying
    materializer object -- that way if someone is reusing a materializer definition they
    can do so in other driver runs/etc.
    skrawcz committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    8eb9971 View commit details
    Browse the repository at this point in the history
  2. Splits applies_to for save & loader adapters

    Given A --> B
    
    For this directional edge to be valid we want A to be a subclass of what B takes.
    
    For loaders -- we're checking A, the loader,  can be fed into B.  e.g. is loader_A a subclass of input B can take. i.e. the decision function is (loader, function)
    For savers -- we're checking A, the function, can be fed into B the saver. e.g.  function_A a subclass of input B the saver can take. i.e. the decision function is (function, loader)
    
    In the code, though, we are treating the two cases the same, as a decision of (loader, function). So this fixes
    that by creating two separate functions for a saver and a loader. That way the directional check is correct.
    
    Adds tests for it.
    skrawcz committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    edc362f View commit details
    Browse the repository at this point in the history
  3. Adds support for Any type in subclass check

    We want to enable the case where `Any` can be
    a super type of any type.
    
    So this change makes enables the code to short circuit if
    we're asking whether something is a subclass of the "Any"
    type.
    skrawcz committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    0b7d5f4 View commit details
    Browse the repository at this point in the history
  4. Adds logic to warn when multiple adapters are applicable

    Rather than default returning to the last one. We should
    check for all, and then return the last one, but warn in the
    case of multiple being present. This I think will result in
    a better experience. We could make the logging
    statement a debug one, but we can change that later.
    skrawcz committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    c464d86 View commit details
    Browse the repository at this point in the history
  5. Refactors converting output values into strings

    So both the driver and materializer need to handle converting
    function names and variables into strings.
    
    This is a little messy -- but it centralizes logic in common.
    I didn't bother with another file because I didn't know what to call it.
    So putting under common seems fine.
    
    Otherwise I added tests to ensure that new functionality works,
    and left the existing tests to ensure nothing broke.
    skrawcz committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    803fd65 View commit details
    Browse the repository at this point in the history
  6. Adds in memory data saver

    So that one can do the following:
    
    ```python
    
    to.memory(
         id="output_df",
         dependencies=outputs,
         combine=base.PandasDataFrameResult()
        ),
    ```
    i.e. reuse any result builder and get that result return
    in memory. This is in effect helps one to dynamically add/adjust
    a result builder -- which I think is useful for development.
    skrawcz committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    828db77 View commit details
    Browse the repository at this point in the history
  7. Split up default data adapters

    With the change of applies_to -- it means
    that single classes are not a good idea. So splitting
    up the default ones appropriately.
    skrawcz committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    43edce5 View commit details
    Browse the repository at this point in the history
  8. Adds telemetry to materialize

    We missed adding it -- along with the nice error message
    for helping people get to slack.
    
    I think what I did makes sense, and mirrors what .execute()
    does right now.
    skrawcz committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    6095852 View commit details
    Browse the repository at this point in the history