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

[xy] Fix list index out of range for dynamic blocks. #4688

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

wangxiaoyou1993
Copy link
Member

Description

Fix list index out of range for dynamic blocks.

image

When setting both regular block and dynamic block as upstream blocks, dynamic child block throws the "list index out of range" error upon execution

Error

Traceback (most recent call last):

  File "/usr/local/lib/python3.10/site-packages/mage_ai/shared/retry.py", line 38, in retry_func

    return func(*args, **kwargs)

  File "/usr/local/lib/python3.10/site-packages/mage_ai/data_preparation/executors/block_executor.py", line 588, in __execute_with_retry

    return self._execute(

  File "/usr/local/lib/python3.10/site-packages/mage_ai/data_preparation/executors/block_executor.py", line 1077, in _execute

    result = self.block.execute_sync(

  File "/usr/local/lib/python3.10/site-packages/mage_ai/data_preparation/models/block/__init__.py", line 1315, in execute_sync

    raise err

  File "/usr/local/lib/python3.10/site-packages/mage_ai/data_preparation/models/block/__init__.py", line 1224, in execute_sync

    output = self.execute_block(

  File "/usr/local/lib/python3.10/site-packages/mage_ai/data_preparation/models/block/__init__.py", line 1512, in execute_block

    self.__get_outputs_from_input_vars(

  File "/usr/local/lib/python3.10/site-packages/mage_ai/data_preparation/models/block/__init__.py", line 1454, in __get_outputs_from_input_vars

    input_vars, kwargs_vars, upstream_block_uuids = self.fetch_input_variables(

  File "/usr/local/lib/python3.10/site-packages/mage_ai/data_preparation/models/block/__init__.py", line 1812, in fetch_input_variables

    return fetch_input_variables_for_dynamic_upstream_blocks(

  File "/usr/local/lib/python3.10/site-packages/mage_ai/data_preparation/models/block/dynamic/variables.py", line 527, in fetch_input_variables_for_dynamic_upstream_blocks

    kwargs_vars.append(kr[0])

IndexError: list index out of range

How Has This Been Tested?

  • Tested with the dynamic blocks. It succeeded
image

Checklist

  • The PR is tagged with proper labels (bug, enhancement, feature, documentation)
  • I have performed a self-review of my own code
  • I have added unit tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • If new documentation has been added, relative paths have been added to the appropriate section of docs/mint.json

cc:

@wangxiaoyou1993 wangxiaoyou1993 added the bug Something isn't working label Mar 1, 2024
@wangxiaoyou1993 wangxiaoyou1993 merged commit e303315 into master Mar 1, 2024
9 checks passed
@wangxiaoyou1993 wangxiaoyou1993 deleted the xiaoyou/fix-dynamic-block-vars branch March 1, 2024 09:37
@wangxiaoyou1993 wangxiaoyou1993 mentioned this pull request Mar 13, 2024
15 tasks
oonyoontong pushed a commit to bunker-tech/mage-ai that referenced this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant