Repository: PrefectHQ/prefect

Issue:
new `typer` seems to break our CLI
### 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
> [!IMPORTANT]
> this issue breaks `prefect deploy` and `prefect deployment run` in all scenarios where a user does not have `typer` pinned below `0.10.0`


it _is_ related to a dependency, `typer` just [released](https://github.com/tiangolo/typer/releases/tag/0.10.0) a couple hours ago and changed default behavior - see failures [here](https://github.com/PrefectHQ/prefect/actions/runs/8403916211/job/23014943478?pr=12396)

in places in the CLI where we have `some_flag: List[Any] = typer.Option(None)` we will now get `None` instead of a list, hence the `NoneType` is not iterable error

### Reproduction

```python3
run tests
```


### Error

```python3
>           for name in names:
E           TypeError: 'NoneType' object is not iterable

# where
        names: List[str] = typer.Option(
            None,
            "--name",
            "-n",
            help=(
                "The name to give the deployment. Can be a pattern. Examples:"
                " 'my-deployment', 'my-flow/my-deployment', 'my-deployment-*',"
                " '*-flow-name/deployment*'"
            ),
        ),
```


### Versions

```Text
» prefect version
Version:             2.16.5+6.gbf44bd25f7
API version:         0.8.4
Python version:      3.12.2
Git commit:          bf44bd25
Built:               Fri, Mar 22, 2024 6:59 PM
OS/Arch:             darwin/arm64
Profile:             staging
Server type:         cloud
```


### Additional context

_No response_


Discussion:

Resolving patch:
diff --git a/src/prefect/cli/deploy.py b/src/prefect/cli/deploy.py
--- a/src/prefect/cli/deploy.py
+++ b/src/prefect/cli/deploy.py
@@ -271,7 +271,7 @@ async def deploy(
             prefect_file=prefect_file, ci=ci
         )
         parsed_names = []
-        for name in names:
+        for name in names or []:
             if "*" in name:
                 parsed_names.extend(_parse_name_from_pattern(deploy_configs, name))
             else:
diff --git a/src/prefect/cli/deployment.py b/src/prefect/cli/deployment.py
--- a/src/prefect/cli/deployment.py
+++ b/src/prefect/cli/deployment.py
@@ -884,7 +884,7 @@ async def run(
         ),
     ),
     tags: List[str] = typer.Option(
-        [],
+        None,
         "--tag",
         help=("Tag(s) to be applied to flow run."),
     ),
@@ -930,7 +930,7 @@ async def run(
             exit_with_error(
                 "`--watch-interval` can only be used with `--watch`.",
             )
-    cli_params = _load_json_key_values(params, "parameter")
+    cli_params = _load_json_key_values(params or [], "parameter")
     conflicting_keys = set(cli_params.keys()).intersection(multi_params.keys())
     if conflicting_keys:
         app.console.print(
@@ -939,7 +939,7 @@ async def run(
         )
     parameters = {**multi_params, **cli_params}
 
-    job_vars = _load_json_key_values(job_variables, "job variable")
+    job_vars = _load_json_key_values(job_variables or [], "job variable")
     if start_in and start_at:
         exit_with_error(
             "Only one of `--start-in` or `--start-at` can be set, not both."


Test patch:
diff --git a/tests/cli/test_agent.py b/tests/cli/test_agent.py
--- a/tests/cli/test_agent.py
+++ b/tests/cli/test_agent.py
@@ -139,7 +139,7 @@ def test_start_agent_respects_work_queue_names(monkeypatch):
     )
     mock_agent.assert_called_once_with(
         work_queues=["a", "b"],
-        work_queue_prefix=[],
+        work_queue_prefix=None,
         work_pool_name=None,
         prefetch_seconds=ANY,
         limit=None,
@@ -171,7 +171,7 @@ def test_start_agent_respects_limit(monkeypatch):
     )
     mock_agent.assert_called_once_with(
         work_queues=["test"],
-        work_queue_prefix=[],
+        work_queue_prefix=None,
         work_pool_name=None,
         prefetch_seconds=ANY,
         limit=10,
@@ -187,7 +187,7 @@ def test_start_agent_respects_work_pool_name(monkeypatch):
     )
     mock_agent.assert_called_once_with(
         work_queues=["test"],
-        work_queue_prefix=[],
+        work_queue_prefix=None,
         work_pool_name="test-pool",
         prefetch_seconds=ANY,
         limit=None,
@@ -221,7 +221,7 @@ def test_start_agent_with_just_work_pool(monkeypatch):
     )
     mock_agent.assert_called_once_with(
         work_queues=[],
-        work_queue_prefix=[],
+        work_queue_prefix=None,
         work_pool_name="test-pool",
         prefetch_seconds=ANY,
         limit=None,
diff --git a/tests/cli/test_worker.py b/tests/cli/test_worker.py
--- a/tests/cli/test_worker.py
+++ b/tests/cli/test_worker.py
@@ -233,7 +233,7 @@ def test_start_worker_with_prefetch_seconds(monkeypatch):
     mock_worker.assert_called_once_with(
         name=None,
         work_pool_name="test",
-        work_queues=[],
+        work_queues=None,
         prefetch_seconds=30,
         limit=None,
         heartbeat_interval_seconds=30,
@@ -261,7 +261,7 @@ def test_start_worker_with_prefetch_seconds_from_setting_by_default(monkeypatch)
     mock_worker.assert_called_once_with(
         name=None,
         work_pool_name="test",
-        work_queues=[],
+        work_queues=None,
         prefetch_seconds=100,
         limit=None,
         heartbeat_interval_seconds=30,
@@ -290,7 +290,7 @@ def test_start_worker_with_limit(monkeypatch):
     mock_worker.assert_called_once_with(
         name=None,
         work_pool_name="test",
-        work_queues=[],
+        work_queues=None,
         prefetch_seconds=10,
         limit=5,
         heartbeat_interval_seconds=30,