Repository: PrefectHQ/prefect

Issue:
CLI incorrectly shows work-queue concurrency limi as None when set to 0
### 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

The concurrency limit of `my-queue` is set to `0` in the UI.

```
❯ prefect -p prd work-queue ls --pool eks-europe-1
              Work Queues in Work Pool 'eks-europe-1'               
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓
┃ Name                              ┃ Priority ┃ Concurrency Limit ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩
│ my-queue                          │ 6        │ None              │
│ default                           │ 1        │ 100               │
└───────────────────────────────────┴──────────┴───────────────────┘
```

### Reproduction

```python3
N/A
```


### Error

_No response_

### Versions

```Text
server = 2.16.4
client = 2.16.4


❯ prefect version
Version:             2.16.4
API version:         0.8.4
Python version:      3.10.10
Git commit:          e3e7df9d
Built:               Thu, Mar 14, 2024 5:11 PM
OS/Arch:             darwin/x86_64
Profile:             default
Server type:         ephemeral
Server:
  Database:          sqlite
  SQLite version:    3.39.4

```
```


### Additional context

_No response_


Discussion:

Resolving patch:
diff --git a/src/prefect/cli/work_pool.py b/src/prefect/cli/work_pool.py
--- a/src/prefect/cli/work_pool.py
+++ b/src/prefect/cli/work_pool.py
@@ -259,7 +259,7 @@ def sort_by_created_key(q):
             str(pool.id),
             (
                 f"[red]{pool.concurrency_limit}"
-                if pool.concurrency_limit
+                if pool.concurrency_limit is not None
                 else "[blue]None"
             ),
         ]
diff --git a/src/prefect/cli/work_queue.py b/src/prefect/cli/work_queue.py
--- a/src/prefect/cli/work_queue.py
+++ b/src/prefect/cli/work_queue.py
@@ -417,7 +417,7 @@ def sort_by_created_key(q):
                     str(queue.id),
                     (
                         f"[red]{queue.concurrency_limit}"
-                        if queue.concurrency_limit
+                        if queue.concurrency_limit is not None
                         else "[blue]None"
                     ),
                 ]
@@ -458,7 +458,7 @@ def sort_by_created_key(q):
                     str(queue.id),
                     (
                         f"[red]{queue.concurrency_limit}"
-                        if queue.concurrency_limit
+                        if queue.concurrency_limit is not None
                         else "[blue]None"
                     ),
                 ]
@@ -493,7 +493,7 @@ def sort_by_created_key(q):
                     f"{queue.priority}",
                     (
                         f"[red]{queue.concurrency_limit}"
-                        if queue.concurrency_limit
+                        if queue.concurrency_limit is not None
                         else "[blue]None"
                     ),
                 ]


Test patch:
diff --git a/tests/cli/test_work_pool.py b/tests/cli/test_work_pool.py
--- a/tests/cli/test_work_pool.py
+++ b/tests/cli/test_work_pool.py
@@ -477,6 +477,18 @@ async def test_verbose(self, prefect_client, work_pool):
         )
         assert res.exit_code == 0
 
+    async def test_ls_with_zero_concurrency_limit(self, prefect_client, work_pool):
+        res = await run_sync_in_worker_thread(
+            invoke_and_assert,
+            f"work-pool set-concurrency-limit {work_pool.name} 0",
+        )
+        assert res.exit_code == 0
+        res = await run_sync_in_worker_thread(
+            invoke_and_assert,
+            "work-pool ls",
+        )
+        assert "None" not in res.output
+
 
 class TestUpdate:
     async def test_update_description(self, prefect_client, work_pool):
diff --git a/tests/cli/test_work_queues.py b/tests/cli/test_work_queues.py
--- a/tests/cli/test_work_queues.py
+++ b/tests/cli/test_work_queues.py
@@ -579,6 +579,24 @@ def test_ls_with_pool(
             expected_code=0,
         )
 
+    def test_ls_with_zero_concurrency_limit(
+        self,
+        work_queue_1,
+    ):
+        invoke_and_assert(
+            command=f"work-queue set-concurrency-limit {work_queue_1.name} 0",
+            expected_code=0,
+        )
+        invoke_and_assert(
+            command="work-queue set-concurrency-limit default 0",
+            expected_code=0,
+        )
+        invoke_and_assert(
+            command=f"work-queue ls -p {work_queue_1.work_pool.name}",
+            expected_code=0,
+            expected_output_does_not_contain="None",
+        )
+
     def test_ls_with_bad_pool(
         self,
         work_queue_1,