Area: Observability Issues
Sub-Area: Assertion Configuration
Issue
When creating assertions using the DataHub Cloud Python SDK, setting the cron schedule parameter to None results in a default schedule of "0 0 * * *" (daily at midnight) being applied automatically. Users expecting manual-only assertion execution find that their assertions still run on the default schedule rather than remaining unscheduled for on-demand triggering only.
You Might Be Asking
- Why does setting schedule=None in the Python SDK create a daily schedule instead of no schedule?
- How can I create assertions that only run manually without any automatic schedule?
- Is there a way to prevent assertions from running automatically when using the SDK?
Solution
This behavior is intentional in the DataHub Cloud Python SDK. When you set schedule=None, the SDK applies the default schedule rather than creating an unscheduled assertion. Here are your options for controlling assertion execution:
Option 1: Disable Automatic Execution
- Create the assertion with the default schedule
- Set
enabled: falsein the assertion configuration - This prevents automatic execution while allowing manual triggering
assertion = YourAssertionClass(
# ... other parameters
schedule=None, # This will default to "0 0 * * *"
enabled=False # Prevents automatic execution
)
Option 2: Use Manual Triggering Methods
- Use the "Run Now" button in the DataHub Cloud UI
- Trigger assertions via the DataHub API directly
- These methods work regardless of the assertion's schedule configuration
Option 3: Set Explicit Custom Schedule
If you need specific timing control, provide an explicit cron expression instead of None:
assertion = YourAssertionClass(
# ... other parameters
schedule="0 9 * * MON" # Custom schedule (9 AM every Monday)
)
Additional Notes
The DataHub Assertions platform requires a cron-based evaluation schedule for all assertions. There is no "manual-only" mode available through the Python SDK. The None value was designed to mean "use platform default" rather than "omit schedule entirely." This design prevents assertions from being left in an unmonitored state and aligns with DataHub Cloud's managed scheduling architecture. As of version 0.3.17.5, all assertion types default to the daily schedule "0 0 * * *" when no explicit schedule is provided.
Related Documentation
Tags: assertions, scheduling, python-sdk, manual-trigger, cron, default-behavior, observability, on-demand, datahub-cloud