Mapping SKIPed Task Runs Bug
See original GitHub issueOpened from the Prefect Public Slack Community
michael.ludwig: This is how we apply map:
bucket_prefix = create_bucket_prefix_rfy()
prediction_single_files = list_files(s3_folder=prediction)
return load_rfy.map(
input_data_location=prediction_single_files,
bucket_prefix=unmapped(bucket_prefix),
)
michael.ludwig: We have a custom trigger but maybe something is broken with that guy when working with “Mapped” states:
def _trigger(self, upstream_states: Dict[Edge, State]) -> bool:
partition = self.check_partition()
self.log_info(f"partition exists: {partition.exists}")
if (
trigger_run(
list(upstream_states.values()),
self._ignore_upstream_success_states_for_triggering,
)
or not partition.exists
):
self.log_info(f"Triggering {self._name}")
return True
self._revision = cast(str, partition.revision)
skip_message = (
f"Partition already exists. Using most recent revision: {self._revision}"
)
self.log_info(skip_message)
self.log_info(f"Skipping {self._name}")
raise SKIP(result=self.get_output(), message=skip_message)
def trigger_run(
upstream_states: Sequence[state.State],
ignore_upstream_success_states_for_triggering: bool,
) -> bool:
n_upstream_states = len(upstream_states)
n_success = sum(1 for task_state in upstream_states if task_state.is_successful())
# If any task before had a different state than success or skip, don't run.
if n_success < n_upstream_states:
raise TRIGGERFAIL(
'Trigger was "all_successful" but some of the upstream tasks failed.'
)
# Don't run this task based on upstream state only
if ignore_upstream_success_states_for_triggering:
return False
n_skipped = sum(1 for task_state in upstream_states if task_state.is_skipped())
# If the number of skipped states were less then the total number of states, run.
return n_skipped < n_upstream_states
znicholasbrown: Hi <@U016C6EMJ6P> - this looks like you may have found a bug; would you please open an issue with your reproduction here and some minimum input data so we can reproduce?
dylan: <@ULVA73B9P> open “Mapping SKIPed Task Runs Bug”
Original thread can be found here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Skip errors to continue discovering an application service
Navigate to the relevant application service map. Click Run discovery. After the discovery process finishes, verify that Service Mapping ...
Read more >"This Mapping task is incompatible with the deployed version ...
In IICS, any modification/update/changes in mapping should be automatically picked-up by Mapping Tasks. This is a bug. The bug number is IF- ...
Read more >Solved: Notebook Tasks suddenly not scheduling
Solved: so i have a Notebook that is scheduled to run every 15 ... There is a bug I have open that is...
Read more >Custom condition should allow marking previous skipped ...
In my scenario, I am testing with skipped Phases instead of Tasks. The skipped phase didn't generate any log, although system.debug=true. Here is...
Read more >Tasks - Prefect 2 - Coordinating the world's dataflows
Calling the task from within a flow function creates a new task run: ... The simplest Prefect map takes a tasks and applies...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Issue 1) sounds a lot like the issue which was just opened here: https://github.com/PrefectHQ/prefect/issues/3124
For issue 1) I have now also some examples:
This task user_data_creator was executed three times and the second and third execution failed because the data is already written.
So maybe the intial title of this issue is misleading because it seems to have nothing to do with triggers.