I'm using 0.15.0 and trying to do a simple partiti...
# ask-community
s
I'm using 0.15.0 and trying to do a simple partitioned set of assets like so:
Copy code
daily_partition_def = DailyPartitionsDefinition(start_date="2022-06-11")


@asset(partitions_def=daily_partition_def)
def first_asset1(context) -> List[str]:
    return "abc".split()


@asset(partitions_def=daily_partition_def)
def second_asset1(context, first_asset1: List[str]) -> List[str]:
    return first_asset1
Yes, I know this doesn't actually do any actual partitioning, but I wanted to provide a minimal example. When I try to materialize things,
first_asset1
materializes just fine. However, all
second_asset1
fail with:
Copy code
dagster.core.errors.DagsterExecutionLoadInputError: Error occurred while loading input "first_asset1" of step "second_asset1"::

TypeError: __new__() missing 2 required positional arguments: 'tag' and 'attributes'

Stack Trace:
  File "/Users/seandavis/Library/Caches/pypoetry/virtualenvs/omicidx-dagster-hzeLYhiC-py3.9/lib/python3.9/site-packages/dagster/core/execution/plan/utils.py", line 47, in solid_execution_error_boundary
    yield
  File "/Users/seandavis/Library/Caches/pypoetry/virtualenvs/omicidx-dagster-hzeLYhiC-py3.9/lib/python3.9/site-packages/dagster/core/execution/plan/inputs.py", line 829, in _load_input_with_input_manager
    value = input_manager.load_input(context)
  File "/Users/seandavis/Library/Caches/pypoetry/virtualenvs/omicidx-dagster-hzeLYhiC-py3.9/lib/python3.9/site-packages/dagster/core/storage/fs_io_manager.py", line 169, in load_input
I haven't implemented an IOManager for a simple list of strings and may be misunderstanding default behavior. I didn't find any runnable examples of date-partitioned assets, so any pointers to code examples would be helpful. Thanks.
c
Hi Sean. How are you executing this? Can you confirm that this is running on 0.15.0? I'm able to run this code successfully in dagit:
Copy code
daily_partition_def = DailyPartitionsDefinition(start_date="2022-06-11")


@asset(partitions_def=daily_partition_def)
def first_asset1(context) -> List[str]:
    return "abc".split()


@asset(partitions_def=daily_partition_def)
def second_asset1(context, first_asset1: List[str]) -> List[str]:
    return first_asset1


my_job = build_assets_job(
    "my_job", [first_asset1, second_asset1], resource_defs={"io_manager": fs_io_manager}
)
The implementation looks correct as far as I can see
s
My minimal example was too minimal. The issue arises when I use a generator to create the list in "first_asset1" where the generator return type was not specified. In the future, I'll probably write an IOmanager anyway, but I think I have a diagnosis and fix for the problem that I was observing. You are correct that the above code works. Apologies for not being more careful in the report.
🎉 1
c
No problem, glad it worked out!