Skip to content

Commit

Permalink
Fixes tests for httpx 0.23.2
Browse files Browse the repository at this point in the history
  • Loading branch information
desertaxle committed Jan 3, 2023
1 parent d38a28d commit 2612dfb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/prefect/client/orion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@ async def read_flow_run_states(
of the flow run states
"""
response = await self._client.get(
"/flow_run_states/", params=dict(flow_run_id=flow_run_id)
"/flow_run_states/", params=dict(flow_run_id=str(flow_run_id))
)
return pydantic.parse_obj_as(List[prefect.states.State], response.json())

Expand Down Expand Up @@ -1753,7 +1753,7 @@ async def read_task_run_states(
a list of State model representations of the task run states
"""
response = await self._client.get(
"/task_run_states/", params=dict(task_run_id=task_run_id)
"/task_run_states/", params=dict(task_run_id=str(task_run_id))
)
return pydantic.parse_obj_as(List[prefect.states.State], response.json())

Expand Down
2 changes: 1 addition & 1 deletion tests/orion/api/test_flow_run_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def test_read_flow_run_state(
session,
):
response = await client.get(
"/flow_run_states/", params=dict(flow_run_id=flow_run.id)
"/flow_run_states/", params=dict(flow_run_id=str(flow_run.id))
)
assert response.status_code == status.HTTP_200_OK
response_state_ids = {state["id"] for state in response.json()}
Expand Down
2 changes: 1 addition & 1 deletion tests/orion/api/test_task_run_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def test_read_task_run_state_returns_404_if_does_not_exist(self, client):
class TestReadTaskRunStateByTaskRunId:
async def test_read_task_run_state(self, task_run, task_run_states, client):
response = await client.get(
"/task_run_states/", params=dict(task_run_id=task_run.id)
"/task_run_states/", params=dict(task_run_id=str(task_run.id))
)
assert response.status_code == status.HTTP_200_OK
response_state_ids = {state["id"] for state in response.json()}
Expand Down
4 changes: 2 additions & 2 deletions tests/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def flaky_function():
assert await state.result() == 1

# Check expected state transitions
states = await orion_client.read_task_run_states(task_run.id)
states = await orion_client.read_task_run_states(str(task_run.id))
state_names = [state.type for state in states]
assert state_names == [
StateType.PENDING,
Expand Down Expand Up @@ -1098,7 +1098,7 @@ def flaky_function():
assert await state.result() == 1

# Check expected state transitions
states = await orion_client.read_flow_run_states(flow_run.id)
states = await orion_client.read_flow_run_states(str(flow_run.id))
state_names = [state.type for state in states]
assert state_names == [
StateType.PENDING,
Expand Down

0 comments on commit 2612dfb

Please sign in to comment.