Skip to content

Error cleanly when no output requested using .materialize #796

Description

@skrawcz

If no output is requested using .materialize() we don't error at all.

Current behavior

It gets stuck in an infinite loop.

Steps to replicate behavior

This recreates the behavior -- there is no output requested.

# test.py
from hamilton import driver
from hamilton.plugins import h_experiments
from hamilton.io.materialization import to, from_

def connect(a:dict) -> str:
    print('connect')
    print(a)
    return 'connect'

if __name__ == "__main__":
    import test

    tracker_hook = h_experiments.ExperimentTracker(
        experiment_name='exp',
        base_directory='.',
    )


    dr = (
        driver.Builder()
        .with_modules(test)
        .enable_dynamic_execution(allow_experimental_mode=True)
        # .with_execution_manager(execution_manager)
        .with_adapters(tracker_hook)
        .build()
    )
    materilizers = [
        from_.pickle(path='./data.pickle', target='a'),
    ]
    dr.materialize(*materilizers)

Library & System Information

Latest hamilton, mac.

Expected behavior

It errors out.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    triagelabel for issues that need to be triaged.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions