https://dagster.io/ logo
#ask-community
Title
# ask-community
n

Nicholas Pezolano

05/24/2023, 3:56 PM
I'm running into an issue with the latest version of dagster 1.3.5 for something that previously worked, I can run the same function outside of dagster with no issues, so I'm not sure what's causing this The below snippet throws the following error:
Copy code
@asset(partitions_def=my_partitions_def)
def test_error(context):
    import pandas_market_calendars as mcal
    dt = '2023-05-23'
    prev = '2023-04-09'
    exchange = 'NYSE'
    nyse = mcal.get_calendar(exchange)
    dts = nyse.schedule(start_date=prev, end_date=dt)
    return True
The Error:
Copy code
dagster._core.errors.DagsterExecutionStepExecutionError: Error occurred while executing op "test_error":

  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_core/execution/plan/execute_plan.py", line 262, in dagster_event_sequence_for_step
    for step_event in check.generator(step_events):
  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_core/execution/plan/execute_step.py", line 369, in core_dagster_event_sequence_for_step
    for user_event in check.generator(
  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_core/execution/plan/execute_step.py", line 90, in _step_output_error_checked_user_event_sequence
    for user_event in user_event_sequence:
  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_core/execution/plan/compute.py", line 192, in execute_core_compute
    for step_output in _yield_compute_results(step_context, inputs, compute_fn):
  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_core/execution/plan/compute.py", line 161, in _yield_compute_results
    for event in iterate_with_context(
  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_utils/__init__.py", line 443, in iterate_with_context
    with context_fn():
  File "/home/n/anaconda3/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_core/execution/plan/utils.py", line 84, in op_execution_error_boundary
    raise error_cls(

The above exception was caused by the following exception:
TypeError: Instance and class checks can only be used with @runtime protocols

  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_core/execution/plan/utils.py", line 54, in op_execution_error_boundary
    yield
  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_utils/__init__.py", line 445, in iterate_with_context
    next_output = next(iterator)
  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_core/execution/plan/compute_generator.py", line 124, in _coerce_op_compute_fn_to_iterator
    result = invoke_compute_fn(
  File "/home/n/anaconda3/lib/python3.10/site-packages/dagster/_core/execution/plan/compute_generator.py", line 118, in invoke_compute_fn
    return fn(context, **args_to_pass) if context_arg_provided else fn(**args_to_pass)
  File "/home/n/git/botat2/dagster/nmr_dagster/assets/test_assets.py", line 39, in sr_test
    dts = nyse.schedule(start_date=prev, end_date=dt)
  File "/home/n/anaconda3/lib/python3.10/site-packages/pandas_market_calendars/market_calendar.py", line 611, in schedule
    schedule = pd.DataFrame()
  File "/home/n/anaconda3/lib/python3.10/site-packages/pandas/core/frame.py", line 807, in __init__
    mgr = dict_to_mgr(
  File "/home/n/anaconda3/lib/python3.10/site-packages/pandas/core/internals/construction.py", line 431, in dict_to_mgr
    arrays = Series(data, index=columns, dtype=object)
  File "/home/n/anaconda3/lib/python3.10/site-packages/pandas/core/series.py", line 472, in __init__
    data, index = self._init_dict(data, index, dtype)
  File "/home/n/anaconda3/lib/python3.10/site-packages/pandas/core/series.py", line 565, in _init_dict
    s = Series(values, index=keys, dtype=dtype)
  File "/home/n/anaconda3/lib/python3.10/site-packages/pandas/core/series.py", line 490, in __init__
    data = com.maybe_iterable_to_list(data)
  File "/home/n/anaconda3/lib/python3.10/site-packages/pandas/core/common.py", line 300, in maybe_iterable_to_list
    if isinstance(obj, abc.Iterable) and not isinstance(obj, abc.Sized):
  File "/home/n/anaconda3/lib/python3.10/abc.py", line 119, in __instancecheck__
    return _abc_instancecheck(cls, instance)
  File "/home/n/anaconda3/lib/python3.10/abc.py", line 123, in __subclasscheck__
    return _abc_subclasscheck(cls, subclass)
  File "/home/n/anaconda3/lib/python3.10/site-packages/typing_extensions.py", line 584, in __subclasscheck__
    return super().__subclasscheck__(other)
  File "/home/n/anaconda3/lib/python3.10/abc.py", line 123, in __subclasscheck__
    return _abc_subclasscheck(cls, subclass)
  File "/home/n/anaconda3/lib/python3.10/site-packages/typing_extensions.py", line 703, in _proto_hook
    raise TypeError("Instance and class checks can only be used with"
n

Nicholas Pezolano

05/24/2023, 4:11 PM
Thanks for the quick response! This fixed my issue, I was on 4.6
4 Views