Separately, I am trying to materialize the 'abc|t...
# ask-community
m
Separately, I am trying to materialize the 'abc|tv' partition for this asset through the UI and I get an error in Windows, but it works fine on Mac (I asked a colleague to test the same code).
Copy code
from dagster import Definitions, asset, MultiPartitionsDefinition, StaticPartitionsDefinition

# Asset for external tables
@asset( 
    partitions_def=MultiPartitionsDefinition({
        "customer_code": StaticPartitionsDefinition(['abc','youi']),
        "datasource_name": StaticPartitionsDefinition(['tv','search']),
    })
)
def external_table(context):
    parition_keys = <http://context.log.info|context.log.info>(context.partition_key.keys_by_dimension)
    return_val = f"materialized external table for {parition_keys=}"
    <http://context.log.info|context.log.info>(return_val)
    return return_val

defs = Definitions(
    assets= [external_table]
)
Error message:
Copy code
dagster._core.errors.DagsterExecutionHandleOutputError: Error occurred while handling output "result" of step "external_table":
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_plan.py", line 266, in dagster_event_sequence_for_step
    for step_event in check.generator(step_events):
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 394, in core_dagster_event_sequence_for_step
    for evt in _type_check_and_store_output(step_context, user_event, input_lineage):
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 451, in _type_check_and_store_output
    for evt in _store_output(step_context, step_output_handle, output, input_lineage):
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 636, in _store_output
    for elt in iterate_with_context(
  File "C:\Python310\lib\site-packages\dagster\_utils\__init__.py", line 456, in iterate_with_context
    with context_fn():
  File "C:\Python310\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\utils.py", line 86, in op_execution_error_boundary
    raise error_cls(
The above exception was caused by the following exception:
OSError: [Errno 22] Invalid argument: 'C:\\Users\\manan patel\\OneDrive - Altis Consulting P L\\Documents\\Projects\\Clients\\2022\\Mutinex\\repo\\monorepo\\dagster\\tmpx_pk7u1y\\storage\\external_table\\abc|tv'
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\utils.py", line 56, in op_execution_error_boundary
    yield
  File "C:\Python310\lib\site-packages\dagster\_utils\__init__.py", line 458, in iterate_with_context
    next_output = next(iterator)
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 626, in _gen_fn
    gen_output = output_manager.handle_output(output_context, output.value)
  File "C:\Python310\lib\site-packages\dagster\_core\storage\upath_io_manager.py", line 231, in handle_output
    self.dump_to_path(context=context, obj=obj, path=path)
  File "C:\Python310\lib\site-packages\dagster\_core\storage\fs_io_manager.py", line 148, in dump_to_path
    with path.open("wb") as file:
  File "C:\Python310\lib\pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
j
Hi @Manan P can you confirm that the path
C:\\Users\\manan patel\\OneDrive - Altis Consulting P L\\Documents\\Projects\\Clients\\2022\\Mutinex\\repo\\monorepo\\dagster\\tmpx_pk7u1y\\storage\\external_table\\
is valid on your computer?
m
Hi @jamie, That path did not exist, so I tried again after setting the DAGSTER_HOME environment variable to
C:\\Users\\manan patel\\OneDrive - Altis Consulting P L\\Documents\\Projects\\Clients\\2022\\Mutinex\\repo\\monorepo\\dagster\\
. A similar error occurs:
Copy code
dagster._core.errors.DagsterExecutionHandleOutputError: Error occurred while handling output "result" of step "external_table":
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_plan.py", line 266, in dagster_event_sequence_for_step
    for step_event in check.generator(step_events):
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 394, in core_dagster_event_sequence_for_step
    for evt in _type_check_and_store_output(step_context, user_event, input_lineage):
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 451, in _type_check_and_store_output
    for evt in _store_output(step_context, step_output_handle, output, input_lineage):
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 636, in _store_output
    for elt in iterate_with_context(
  File "C:\Python310\lib\site-packages\dagster\_utils\__init__.py", line 456, in iterate_with_context
    with context_fn():
  File "C:\Python310\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\utils.py", line 86, in op_execution_error_boundary
    raise error_cls(
The above exception was caused by the following exception:
OSError: [Errno 22] Invalid argument: 'C:\\Users\\manan patel\\OneDrive - Altis Consulting P L\\Documents\\Projects\\Clients\\2022\\Mutinex\\repo\\monorepo\\dagster\\storage\\external_table\\abc|tv'
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\utils.py", line 56, in op_execution_error_boundary
    yield
  File "C:\Python310\lib\site-packages\dagster\_utils\__init__.py", line 458, in iterate_with_context
    next_output = next(iterator)
  File "C:\Python310\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 626, in _gen_fn
    gen_output = output_manager.handle_output(output_context, output.value)
  File "C:\Python310\lib\site-packages\dagster\_core\storage\upath_io_manager.py", line 231, in handle_output
    self.dump_to_path(context=context, obj=obj, path=path)
  File "C:\Python310\lib\site-packages\dagster\_core\storage\fs_io_manager.py", line 148, in dump_to_path
    with path.open("wb") as file:
  File "C:\Python310\lib\pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
However, I can now confirm that the path
C:\\Users\\manan patel\\OneDrive - Altis Consulting P L\\Documents\\Projects\\Clients\\2022\\Mutinex\\repo\\monorepo\\dagster\\storage\\external_table\\
exists.
a
I'm having a similar issue as I'm not able to materialize the example asset provided in the doc.
Copy code
dagster._core.errors.DagsterExecutionHandleOutputError: Error occurred while handling output "result" of step "multi_partitions_asset":

  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_core\execution\plan\execute_plan.py", line 265, in dagster_event_sequence_for_step
    for step_event in check.generator(step_events):
  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 388, in core_dagster_event_sequence_for_step
    for evt in _type_check_and_store_output(step_context, user_event, input_lineage):
  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 444, in _type_check_and_store_output
    for evt in _store_output(step_context, step_output_handle, output, input_lineage):
  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 631, in _store_output
    for elt in iterate_with_context(
  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_utils\__init__.py", line 467, in iterate_with_context
    with context_fn():
  File "D:\Python\Python310\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_core\execution\plan\utils.py", line 85, in op_execution_error_boundary
    raise error_cls(

The above exception was caused by the following exception:
OSError: [Errno 22] Invalid argument: 'D:\\Documents\\Projets\\tasks-runner\\dagster_home\\storage\\multi_partitions_asset\\red|2023-02-08'

  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_core\execution\plan\utils.py", line 55, in op_execution_error_boundary
    yield
  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_utils\__init__.py", line 469, in iterate_with_context
    next_output = next(iterator)
  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 621, in _gen_fn
    gen_output = output_manager.handle_output(output_context, output.value)
  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_core\storage\upath_io_manager.py", line 226, in handle_output
    self.dump_to_path(context=context, obj=obj, path=path)
  File "D:\Documents\Projets\tasks-runner\venv\lib\site-packages\dagster\_core\storage\fs_io_manager.py", line 148, in dump_to_path
    with path.open("wb") as file:
  File "D:\Python\Python310\lib\pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
Any update on this ?
j
ok thanks for the report. @claire is there anything with how the multi partition key is created that could be the issue? otherwise i can set up a virtual windows machine and try to replicate
👍 1
c
Hm... I did a quick search and it looks like the "|" delimiter character we use in multipartition keys might be invalid on windows: https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names Which is probably why creating this filename is invalid. @Manan P could I ask you to file an issue for this for tracking purposes?
m
c
Thanks! We'll try and put a fix out for this
a
Thanks a lot !!