From a0bec89ff5dc227788a96e8f6c145e1310e1b0a6 Mon Sep 17 00:00:00 2001 From: JamieDeMaria Date: Fri, 26 Jan 2024 16:10:21 -0500 Subject: [PATCH] make pyright happy --- .../definitions_tests/test_multi_partitions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python_modules/dagster/dagster_tests/definitions_tests/test_multi_partitions.py b/python_modules/dagster/dagster_tests/definitions_tests/test_multi_partitions.py index 386a350dbe12b..eae136d2baa67 100644 --- a/python_modules/dagster/dagster_tests/definitions_tests/test_multi_partitions.py +++ b/python_modules/dagster/dagster_tests/definitions_tests/test_multi_partitions.py @@ -519,14 +519,18 @@ def test_context_partition_time_window(): @asset(partitions_def=partitions_def) def my_asset(context: AssetExecutionContext): + time_partition = get_time_partitions_def(partitions_def) + if time_partition is None: + assert False, "expected a time component in the partitions definition" + time_window = TimeWindow( start=pendulum.instance( datetime(year=2020, month=1, day=1), - tz=get_time_partitions_def(partitions_def).timezone, + tz=time_partition.timezone, ), end=pendulum.instance( datetime(year=2020, month=1, day=2), - tz=get_time_partitions_def(partitions_def).timezone, + tz=time_partition.timezone, ), ) assert context.partition_time_window == time_window