Louis Trezzini
05/01/2023, 8:23 PMsandy
05/03/2023, 12:05 AMclaire
05/03/2023, 4:46 PMLouis Trezzini
05/03/2023, 6:00 PMdef load_input(self, context: InputContext) -> Any:
if context.has_asset_partitions and not context.asset_partitions_def.has_partition_key(context.partition_key):
context.log.warning("missing partition")
return None
2. Tweak the definition of asset C:
def asset_c(context: OpExecutionContext, asset_a: pd.DataFrame, asset_b: Optional[set[str]]) -> Output[DataFrame]:
if asset_b is None:
asset_b = set()
claire
05/03/2023, 7:14 PMTimeWindowPartitionMapping
to filter out nonexistent partitions.
So for the Oct 31 2022 .... April 14 2023 partitions in the downstream asset, the partition mapping would return an empty list of upstream partition dependencies. Subsequently, there would be no upstream partitions and the asset would just receive a None/empty dict input.claire
05/03/2023, 7:16 PMLouis Trezzini
05/03/2023, 7:16 PMLouis Trezzini
05/24/2023, 2:20 AMdagster._core.errors.DagsterInvalidInvocationError: Provided time windows [TimeWindow(start=DateTime(2023, 3, 22, 0, 0, 0, tzinfo=Timezone('UTC')), end=DateTime(2023, 3, 23, 0, 0, 0, tzinfo=Timezone('UTC')))] contain invalid time windows for partitions definition Daily, starting 2023-04-14 UTC.
File "/usr/local/lib/python3.9/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 "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/plan/execute_step.py", line 335, in core_dagster_event_sequence_for_step
for event_or_input_value in step_input.source.load_input_object(step_context, input_def):
File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/plan/inputs.py", line 166, in load_input_object
load_input_context = step_context.for_input_manager(
File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/context/system.py", line 632, in for_input_manager
self.asset_partitions_subset_for_input(name)
File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/context/system.py", line 967, in asset_partitions_subset_for_input
return partition_mapping.get_upstream_partitions_for_partitions(
File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/time_window_partition_mapping.py", line 114, in get_upstream_partitions_for_partitions
return self._map_partitions(
File "/usr/local/lib/python3.9/site-packages/dagster/_core/definitions/time_window_partition_mapping.py", line 244, in _map_partitions
raise DagsterInvalidInvocationError(
I guess we’ll have to tweak TimeWindowPartitionMapping
claire
05/24/2023, 5:48 PMTimeWindowPartitionMapping
that raises this error when the upstream partitions are nonexistent. I think until we add the fix above that allows you to filter out nonexistent partitions instead of raising an error, you will need to keep your dagster version at 1.3.3 and before, sorry about thatLouis Trezzini
05/24/2023, 9:24 PMclaire
05/25/2023, 5:17 PM