Repository: PrefectHQ/prefect

Issue:
Validation error using default interval schedule in `prefect deploy`
### First check

- [X] I added a descriptive title to this issue.
- [X] I used the GitHub search to find a similar issue and didn't find it.
- [X] I searched the Prefect documentation for this issue.
- [X] I checked that this issue is related to Prefect and not one of its dependencies.

### Bug summary

When no value is provided for an interval schedule during `prefect deploy`, we get a Pydantic validation error from `IntervalSchedule` because we have changed the `interval` type from a `timedelta` to a custom `PositiveDuration` type.

### Reproduction

```python3
❯ prefect deploy
? Select a flow to deploy [Use arrows to move; enter to select; n to select none]
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃    ┃ Flow Name                            ┃ Location                    ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ >  │ glass_tower                          │ glass_flow.py               │
└────┴──────────────────────────────────────┴─────────────────────────────┘
    Enter a flow entrypoint manually
? Deployment name (default): 
? Would you like to configure schedules for this deployment? [y/n] (y): 
? What type of schedule would you like to use? [Use arrows to move; enter to select]
┏━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃    ┃ Schedule Type ┃ Description                                                                              ┃
┡━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ >  │ Interval      │ Allows you to set flow runs to be executed at fixed time intervals.                      │
│    │ Cron          │ Allows you to define recurring flow runs based on a specified pattern using cron syntax. │
│    │ RRule         │ Allows you to define recurring flow runs using RFC 2445 recurrence rules.                │
└────┴───────────────┴──────────────────────────────────────────────────────────────────────────────────────────┘
? Seconds between scheduled runs (3600): 
1 validation error for IntervalSchedule
interval
  1 validation error for timedelta
  Input should be a valid timedelta, "day" identifier in duration not correctly formatted 
    For further information visit https://errors.pydantic.dev/1.10/v/time_delta_parsing (type=value_error.validation)
```


### Error

```python3
1 validation error for IntervalSchedule
interval
  1 validation error for timedelta
  Input should be a valid timedelta, "day" identifier in duration not correctly formatted 
    For further information visit https://errors.pydantic.dev/1.10/v/time_delta_parsing (type=value_error.validation)
```


### Versions

```Text
Version:             2.17.1+98.g24199777ce
API version:         0.8.4
Python version:      3.11.1
Git commit:          24199777
Built:               Mon, Apr 22, 2024 4:10 PM
OS/Arch:             darwin/arm64
Profile:             cloud
Server type:         cloud
```


### Additional context

_No response_


Discussion:

Resolving patch:
diff --git a/src/prefect/cli/_prompts.py b/src/prefect/cli/_prompts.py
--- a/src/prefect/cli/_prompts.py
+++ b/src/prefect/cli/_prompts.py
@@ -195,11 +195,19 @@ def prompt_interval_schedule(console):
     """
     Prompt the user for an interval in seconds.
     """
+    default_seconds = 3600
+    # The interval value must be a timedelta object in order to pass validation as a `PositiveDuration` type in `IntervalSchedule`.
+    default_duration = timedelta(seconds=default_seconds)
+
+    # We show the default in the prompt message rather than enabling `show_default=True` here because `rich` displays timedeltas in hours
+    # rather than seconds, which would confuse users since we ask them to enter the interval in seconds.
     interval = IntervalValuePrompt.ask(
-        "[bold][green]?[/] Seconds between scheduled runs",
+        f"[bold][green]?[/] Seconds between scheduled runs ({default_seconds})",
         console=console,
-        default="3600",
+        default=default_duration,
+        show_default=False,
     )
+
     return IntervalSchedule(interval=interval)
 
 


Test patch:
diff --git a/tests/cli/test_deploy.py b/tests/cli/test_deploy.py
--- a/tests/cli/test_deploy.py
+++ b/tests/cli/test_deploy.py
@@ -2500,6 +2500,41 @@ async def test_deploy_interval_schedule_interactive(
         )
         assert deployment.schedules[0].schedule.interval == timedelta(seconds=42)
 
+    @pytest.mark.usefixtures("interactive_console", "project_dir")
+    async def test_deploy_default_interval_schedule_interactive(
+        self, prefect_client, work_pool
+    ):
+        await run_sync_in_worker_thread(
+            invoke_and_assert,
+            command=(
+                f"deploy ./flows/hello.py:my_flow -n test-name --pool {work_pool.name}"
+            ),
+            user_input=(
+                # Confirm schedule creation
+                readchar.key.ENTER
+                # Select interval schedule
+                + readchar.key.ENTER
+                # Enter default interval
+                + readchar.key.ENTER
+                # accept schedule being active
+                + readchar.key.ENTER
+                # decline adding another schedule
+                + readchar.key.ENTER
+                # decline save
+                + "n"
+                + readchar.key.ENTER
+            ),
+            expected_code=0,
+            expected_output_contains=[
+                "Seconds between scheduled runs (3600)",
+            ],
+        )
+
+        deployment = await prefect_client.read_deployment_by_name(
+            "An important name/test-name"
+        )
+        assert deployment.schedules[0].schedule.interval == timedelta(seconds=3600)
+
     @pytest.mark.usefixtures("interactive_console", "project_dir")
     async def test_deploy_cron_schedule_interactive(self, prefect_client, work_pool):
         await run_sync_in_worker_thread(