https://dagster.io/ logo
Title
c

chrispc

09/21/2021, 7:44 AM
Hi team, I am getting a error by running a partition but when I run the test for this scheduler, the test are passed. dagster.core.errors.PartitionExecutionError: Error occurred during the partition config and tag generation for partition set Stucky_scheduler_partitions::2021-07 File "/home//test/venvs/caps/lib64/python3.8/site-packages/dagster/grpc/impl.py", line 386, in get_partition_set_execution_param_data tags = partition_set_def.tags_for_partition(partition) File "/opt/rh/rh-python38/root/usr/lib64/python3.8/contextlib.py", line 131, in exit self.gen.throw(type, value, traceback) File "/home//test/venvs/caps/lib64/python3.8/site-packages/dagster/core/errors.py", line 186, in user_code_error_boundary raise error_cls( The above exception was caused by the following exception: AttributeError: 'NoneType' object has no attribute 'total_seconds' File "/home//test/venvs/caps/lib64/python3.8/site-packages/dagster/core/errors.py", line 179, in user_code_error_boundary yield File "/home//test/venvs/caps/lib64/python3.8/site-packages/dagster/grpc/impl.py", line 385, in get_partition_set_execution_param_data run_config = partition_set_def.run_config_for_partition(partition) File "/home//test/venvs/caps/lib64/python3.8/site-packages/dagster/core/definitions/partition.py", line 386, in run_config_for_partition return self._user_defined_run_config_fn_for_partition(partition) File "/home//test/venvs/caps/lib64/python3.8/site-packages/dagster/core/definitions/decorators/schedule.py", line 241, in <lambda> run_config_fn_for_partition=lambda partition: fn(partition.value), File "/home//test/caps/CAPS/schedulers/scheduler_stucky.py", line 31, in Stucky_scheduler date_yyyy_mm_dd = date + MonthEnd(1) File "pandas/_libs/tslibs/offsets.pyx", line 429, in pandas._libs.tslibs.offsets.BaseOffset.add File "pandas/_libs/tslibs/offsets.pyx", line 431, in pandas._libs.tslibs.offsets.BaseOffset.add File "pandas/_libs/tslibs/offsets.pyx", line 177, in pandas._libs.tslibs.offsets.apply_wraps.wrapper File "pandas/_libs/tslibs/timestamps.pyx", line 1712, in pandas._libs.tslibs.timestamps.Timestamp.tz_localize File "pandas/_libs/tslibs/tzconversion.pyx", line 69, in pandas._libs.tslibs.tzconversion.tz_localize_to_utc_single File "pandas/_libs/tslibs/timezones.pyx", line 266, in pandas._libs.tslibs.timezones.get_dst_info
d

daniel

09/21/2021, 1:51 PM
Hi Christian - it's hard to be 100% sure without seeing the test or the full code, but one possible source of differences is that the real scheduler uses a pendulum datetime? https://pendulum.eustace.io/
c

chrispc

09/21/2021, 2:45 PM
thank you @daniel, well I am following the test proposed by you in https://docs.dagster.io/concepts/partitions-schedules-sensors/schedules#testing-schedules. The test is very simple, but my point is that how can I trust the test if it is testing ok when the scheduler is actually failing.
d

daniel

09/21/2021, 2:45 PM
could you try passing in a pendulum datetime?
it looks like you're running into timezone issues with datetime offsets - pendulum datetimes all have timezones, so maybe that will help idenitfy what's going on
@Dagster Bot docs change schedule testing example to use a pendulum datetime
❤️ 1
d

Dagster Bot

09/21/2021, 2:49 PM
c

chrispc

09/21/2021, 2:58 PM
@daniel I tried (first image), but it is still not properly testing the error I am getting on this line (second image). Actually, I was wondering if you can help me with this, I am trying to get the last day of every month, but I saw Dagster uses the first day as default. In banking companies we are more interested in reporting the data at the end of the month so the data is queried for this date.
d

daniel

09/21/2021, 3:02 PM
does anything change if you create the datetime in US/Central timezone?
since that's what your schedule is using?
c

chrispc

09/21/2021, 3:10 PM
@daniel same error and the test is detecting it now. Thank you!!. What about configured the scheduler to use the last day instead first day for every month?
@daniel it will be nice to have built-in function in Dagster something like this
d

daniel

09/21/2021, 6:47 PM
We’re actually changing these decorators to take in both the start and end of the partition range as arguments as part of our big core API update (cc @sandy ) which I think would address that ask
c

chrispc

09/21/2021, 6:48 PM
@daniel @sandy thank you!!!